From b5f467e63953262b83999170c6d996b9903faece Mon Sep 17 00:00:00 2001 From: Fabien Morin <fabien@nexedi.com> Date: Tue, 9 Jun 2009 11:54:23 +0000 Subject: [PATCH] - add security declaration - typo git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27468 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/PaySheetCell.py | 2 ++ product/ERP5/Document/PaySheetLine.py | 2 +- product/ERP5/Document/PaySheetModelLine.py | 6 +++--- product/ERP5/Document/PaySheetTransaction.py | 14 +++++++++----- product/ERP5/Document/TradeCondition.py | 6 ++++++ product/ERP5/Document/TradeModelLine.py | 4 ++++ 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/product/ERP5/Document/PaySheetCell.py b/product/ERP5/Document/PaySheetCell.py index 325af673d4..b698a1d59d 100644 --- a/product/ERP5/Document/PaySheetCell.py +++ b/product/ERP5/Document/PaySheetCell.py @@ -64,5 +64,7 @@ class PaySheetCell(InvoiceCell): , PropertySheet.MappedValue ) + security.declareProtected(Permissions.AccessContentsInformation, + 'isAccountable') def isAccountable(self): return 1 diff --git a/product/ERP5/Document/PaySheetLine.py b/product/ERP5/Document/PaySheetLine.py index 46716bac74..90d63e41f7 100644 --- a/product/ERP5/Document/PaySheetLine.py +++ b/product/ERP5/Document/PaySheetLine.py @@ -74,7 +74,7 @@ class PaySheetLine(InvoiceLine): self.invokeFactory(type_name="Pay Sheet Cell",id=id) return self.get(id) - security.declareProtected(Permissions.AccessContentsInformationi, + security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable') def isAccountable(self): return 1 diff --git a/product/ERP5/Document/PaySheetModelLine.py b/product/ERP5/Document/PaySheetModelLine.py index 2047e090ba..0e1098fa57 100644 --- a/product/ERP5/Document/PaySheetModelLine.py +++ b/product/ERP5/Document/PaySheetModelLine.py @@ -68,9 +68,9 @@ class PaySheetModelLine(TradeModelLine): , PropertySheet.Predicate , PropertySheet.Reference ) - - security.declareProtected( Permissions.ModifyPortalContent, - 'newCellContent' ) + + security.declareProtected(Permissions.ModifyPortalContent, + 'newCellContent' ) def newCellContent(self, id, portal_type='Pay Sheet Model Cell', **kw): """ Used to be able to create Pay Sheet Model Cell. (portal_type of cells is diff --git a/product/ERP5/Document/PaySheetTransaction.py b/product/ERP5/Document/PaySheetTransaction.py index 06a86ec8cc..8cca193e56 100644 --- a/product/ERP5/Document/PaySheetTransaction.py +++ b/product/ERP5/Document/PaySheetTransaction.py @@ -68,7 +68,7 @@ class PaySheetTransaction(Invoice): __implements__ = ( ) security.declareProtected(Permissions.AccessContentsInformation, - 'getRatioQuantityFromReference') + 'getRatioQuantityFromReference') def getRatioQuantityFromReference(self, ratio_reference=None): """ return the ratio value correponding to the ratio_reference, @@ -91,7 +91,7 @@ class PaySheetTransaction(Invoice): return None security.declareProtected(Permissions.AccessContentsInformation, - 'getRatioQuantityList') + 'getRatioQuantityList') def getRatioQuantityList(self, ratio_reference_list): """ Return a list of reference_ratio_list correponding values. @@ -104,7 +104,7 @@ class PaySheetTransaction(Invoice): for reference in ratio_reference_list] security.declareProtected(Permissions.AccessContentsInformation, - 'getAnnotationLineFromReference') + 'getAnnotationLineFromReference') def getAnnotationLineFromReference(self, reference=None): """Return the annotation line corresponding to the reference. Returns None if reference not found @@ -122,10 +122,10 @@ class PaySheetTransaction(Invoice): return None security.declareProtected(Permissions.AccessContentsInformation, - 'getAnnotationLineListList') + 'getAnnotationLineListList') def getAnnotationLineListList(self, reference_list): """Return a list of annotation lines corresponding to the reference_list - reference_list is a list of references to the Annotation Line we want + reference_list is a list of references to the Annotation Line we want to get. """ if not isinstance(reference_list, (list, tuple)): @@ -133,6 +133,8 @@ class PaySheetTransaction(Invoice): return [self.getAnnotationLineFromReference(reference) \ for reference in reference_list] + security.declareProtected(Permissions.AccessContentsInformation, + 'getInheritedObjectValueList') def getInheritedObjectValueList(self, portal_type_list, property_list=()): '''Return a list of all subobjects of the herited model (incuding the dependencies). @@ -152,6 +154,8 @@ class PaySheetTransaction(Invoice): sub_object_list.extend([model._getOb(x) for x in id_list]) return sub_object_list + security.declareProtected(Permissions.ModifyPortalContent, + 'applyTransformation') def applyTransformation(self): '''use a delivery builder to create all the paysheet lines using movements return by updateAggregatedAmountList diff --git a/product/ERP5/Document/TradeCondition.py b/product/ERP5/Document/TradeCondition.py index 85fa1a73a9..b7835ecd0f 100644 --- a/product/ERP5/Document/TradeCondition.py +++ b/product/ERP5/Document/TradeCondition.py @@ -72,6 +72,8 @@ class TradeCondition(Path, Transformation): , PropertySheet.Order ) + security.declareProtected(Permissions.ModifyPortalContent, + 'updateAggregatedAmountList') def updateAggregatedAmountList(self, context, **kw): ''' updates exisiting movement and returns new if any @@ -142,6 +144,8 @@ class TradeCondition(Path, Transformation): visited_trade_condition_list=visited_trade_condition_list)) return specialise_value_list + security.declareProtected(Permissions.AccessContentsInformation, + 'getTradeModelLineComposedList') def getTradeModelLineComposedList(self, context=None, portal_type_list=None): """ Returns list of Trade Model Lines using composition @@ -178,6 +182,8 @@ class TradeCondition(Path, Transformation): cmp=lambda x,y: set(x.getBaseContributionList()). intersection(set(y.getBaseApplicationList())) and -1 or 1) + security.declareProtected(Permissions.AccessContentsInformation, + 'getAggregatedAmountList') def getAggregatedAmountList(self, context, movement_list=None, **kw): result = AggregatedAmountList() diff --git a/product/ERP5/Document/TradeModelLine.py b/product/ERP5/Document/TradeModelLine.py index 86005d981c..13ec46403c 100644 --- a/product/ERP5/Document/TradeModelLine.py +++ b/product/ERP5/Document/TradeModelLine.py @@ -63,12 +63,16 @@ class TradeModelLine(Predicate, XMLMatrix, Amount): , PropertySheet.Predicate ) + security.declareProtected(Permissions.AccessContentsInformation, + 'getPrice') def getPrice(self): return self._baseGetPrice() def updateAggregatedAmountList(self, context, **kw): raise NotImplementedError('TODO') + security.declareProtected(Permissions.AccessContentsInformation, + 'getAggregatedAmountList') def getAggregatedAmountList(self, context, movement_list = None, current_aggregated_amount_list = None, base_id='movement', **kw): from Products.ERP5Type.Document import newTempSimulationMovement -- 2.30.9