Commit b5f467e6 authored by Fabien Morin's avatar Fabien Morin

- add security declaration

- typo


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27468 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca85c850
...@@ -64,5 +64,7 @@ class PaySheetCell(InvoiceCell): ...@@ -64,5 +64,7 @@ class PaySheetCell(InvoiceCell):
, PropertySheet.MappedValue , PropertySheet.MappedValue
) )
security.declareProtected(Permissions.AccessContentsInformation,
'isAccountable')
def isAccountable(self): def isAccountable(self):
return 1 return 1
...@@ -74,7 +74,7 @@ class PaySheetLine(InvoiceLine): ...@@ -74,7 +74,7 @@ class PaySheetLine(InvoiceLine):
self.invokeFactory(type_name="Pay Sheet Cell",id=id) self.invokeFactory(type_name="Pay Sheet Cell",id=id)
return self.get(id) return self.get(id)
security.declareProtected(Permissions.AccessContentsInformationi, security.declareProtected(Permissions.AccessContentsInformation,
'isAccountable') 'isAccountable')
def isAccountable(self): def isAccountable(self):
return 1 return 1
...@@ -68,9 +68,9 @@ class PaySheetModelLine(TradeModelLine): ...@@ -68,9 +68,9 @@ class PaySheetModelLine(TradeModelLine):
, PropertySheet.Predicate , PropertySheet.Predicate
, PropertySheet.Reference , PropertySheet.Reference
) )
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'newCellContent' ) 'newCellContent' )
def newCellContent(self, id, portal_type='Pay Sheet Model Cell', **kw): 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 Used to be able to create Pay Sheet Model Cell. (portal_type of cells is
......
...@@ -68,7 +68,7 @@ class PaySheetTransaction(Invoice): ...@@ -68,7 +68,7 @@ class PaySheetTransaction(Invoice):
__implements__ = ( ) __implements__ = ( )
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getRatioQuantityFromReference') 'getRatioQuantityFromReference')
def getRatioQuantityFromReference(self, ratio_reference=None): def getRatioQuantityFromReference(self, ratio_reference=None):
""" """
return the ratio value correponding to the ratio_reference, return the ratio value correponding to the ratio_reference,
...@@ -91,7 +91,7 @@ class PaySheetTransaction(Invoice): ...@@ -91,7 +91,7 @@ class PaySheetTransaction(Invoice):
return None return None
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getRatioQuantityList') 'getRatioQuantityList')
def getRatioQuantityList(self, ratio_reference_list): def getRatioQuantityList(self, ratio_reference_list):
""" """
Return a list of reference_ratio_list correponding values. Return a list of reference_ratio_list correponding values.
...@@ -104,7 +104,7 @@ class PaySheetTransaction(Invoice): ...@@ -104,7 +104,7 @@ class PaySheetTransaction(Invoice):
for reference in ratio_reference_list] for reference in ratio_reference_list]
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getAnnotationLineFromReference') 'getAnnotationLineFromReference')
def getAnnotationLineFromReference(self, reference=None): def getAnnotationLineFromReference(self, reference=None):
"""Return the annotation line corresponding to the reference. """Return the annotation line corresponding to the reference.
Returns None if reference not found Returns None if reference not found
...@@ -122,10 +122,10 @@ class PaySheetTransaction(Invoice): ...@@ -122,10 +122,10 @@ class PaySheetTransaction(Invoice):
return None return None
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getAnnotationLineListList') 'getAnnotationLineListList')
def getAnnotationLineListList(self, reference_list): def getAnnotationLineListList(self, reference_list):
"""Return a list of annotation lines corresponding to the 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. to get.
""" """
if not isinstance(reference_list, (list, tuple)): if not isinstance(reference_list, (list, tuple)):
...@@ -133,6 +133,8 @@ class PaySheetTransaction(Invoice): ...@@ -133,6 +133,8 @@ class PaySheetTransaction(Invoice):
return [self.getAnnotationLineFromReference(reference) \ return [self.getAnnotationLineFromReference(reference) \
for reference in reference_list] for reference in reference_list]
security.declareProtected(Permissions.AccessContentsInformation,
'getInheritedObjectValueList')
def getInheritedObjectValueList(self, portal_type_list, property_list=()): def getInheritedObjectValueList(self, portal_type_list, property_list=()):
'''Return a list of all subobjects of the herited model (incuding the '''Return a list of all subobjects of the herited model (incuding the
dependencies). dependencies).
...@@ -152,6 +154,8 @@ class PaySheetTransaction(Invoice): ...@@ -152,6 +154,8 @@ class PaySheetTransaction(Invoice):
sub_object_list.extend([model._getOb(x) for x in id_list]) sub_object_list.extend([model._getOb(x) for x in id_list])
return sub_object_list return sub_object_list
security.declareProtected(Permissions.ModifyPortalContent,
'applyTransformation')
def applyTransformation(self): def applyTransformation(self):
'''use a delivery builder to create all the paysheet lines using '''use a delivery builder to create all the paysheet lines using
movements return by updateAggregatedAmountList movements return by updateAggregatedAmountList
......
...@@ -72,6 +72,8 @@ class TradeCondition(Path, Transformation): ...@@ -72,6 +72,8 @@ class TradeCondition(Path, Transformation):
, PropertySheet.Order , PropertySheet.Order
) )
security.declareProtected(Permissions.ModifyPortalContent,
'updateAggregatedAmountList')
def updateAggregatedAmountList(self, context, **kw): def updateAggregatedAmountList(self, context, **kw):
''' '''
updates exisiting movement and returns new if any updates exisiting movement and returns new if any
...@@ -142,6 +144,8 @@ class TradeCondition(Path, Transformation): ...@@ -142,6 +144,8 @@ class TradeCondition(Path, Transformation):
visited_trade_condition_list=visited_trade_condition_list)) visited_trade_condition_list=visited_trade_condition_list))
return specialise_value_list return specialise_value_list
security.declareProtected(Permissions.AccessContentsInformation,
'getTradeModelLineComposedList')
def getTradeModelLineComposedList(self, context=None, portal_type_list=None): def getTradeModelLineComposedList(self, context=None, portal_type_list=None):
""" """
Returns list of Trade Model Lines using composition Returns list of Trade Model Lines using composition
...@@ -178,6 +182,8 @@ class TradeCondition(Path, Transformation): ...@@ -178,6 +182,8 @@ class TradeCondition(Path, Transformation):
cmp=lambda x,y: set(x.getBaseContributionList()). cmp=lambda x,y: set(x.getBaseContributionList()).
intersection(set(y.getBaseApplicationList())) and -1 or 1) intersection(set(y.getBaseApplicationList())) and -1 or 1)
security.declareProtected(Permissions.AccessContentsInformation,
'getAggregatedAmountList')
def getAggregatedAmountList(self, context, movement_list=None, **kw): def getAggregatedAmountList(self, context, movement_list=None, **kw):
result = AggregatedAmountList() result = AggregatedAmountList()
......
...@@ -63,12 +63,16 @@ class TradeModelLine(Predicate, XMLMatrix, Amount): ...@@ -63,12 +63,16 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
, PropertySheet.Predicate , PropertySheet.Predicate
) )
security.declareProtected(Permissions.AccessContentsInformation,
'getPrice')
def getPrice(self): def getPrice(self):
return self._baseGetPrice() return self._baseGetPrice()
def updateAggregatedAmountList(self, context, **kw): def updateAggregatedAmountList(self, context, **kw):
raise NotImplementedError('TODO') raise NotImplementedError('TODO')
security.declareProtected(Permissions.AccessContentsInformation,
'getAggregatedAmountList')
def getAggregatedAmountList(self, context, movement_list = None, def getAggregatedAmountList(self, context, movement_list = None,
current_aggregated_amount_list = None, base_id='movement', **kw): current_aggregated_amount_list = None, base_id='movement', **kw):
from Products.ERP5Type.Document import newTempSimulationMovement from Products.ERP5Type.Document import newTempSimulationMovement
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment