Commit b6fd5d81 authored by Jérome Perrin's avatar Jérome Perrin

protect methods with AccessContentsInformation, not View


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25040 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 782ef7a5
...@@ -70,7 +70,7 @@ class BudgetCell(Predicate, MetaNode): ...@@ -70,7 +70,7 @@ class BudgetCell(Predicate, MetaNode):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
security.declareProtected(Permissions.View, 'getTitle') security.declareProtected(Permissions.AccessContentsInformation, 'getTitle')
def getTitle(self): def getTitle(self):
""" """
Return a calculated title. Return a calculated title.
...@@ -84,7 +84,7 @@ class BudgetCell(Predicate, MetaNode): ...@@ -84,7 +84,7 @@ class BudgetCell(Predicate, MetaNode):
self.getPortalType() self.getPortalType()
return title return title
security.declareProtected(Permissions.View, 'getCurrentInventory') security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentInventory')
def getCurrentInventory(self, **kw): def getCurrentInventory(self, **kw):
""" """
Returns current inventory Returns current inventory
...@@ -95,14 +95,14 @@ class BudgetCell(Predicate, MetaNode): ...@@ -95,14 +95,14 @@ class BudgetCell(Predicate, MetaNode):
kw['resource'] = resource.getRelativeUrl() kw['resource'] = resource.getRelativeUrl()
return self.portal_simulation.getCurrentInventory(**kw) return self.portal_simulation.getCurrentInventory(**kw)
security.declareProtected(Permissions.View, 'getCurrentBalance') security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentBalance')
def getCurrentBalance(self): def getCurrentBalance(self):
""" """
Returns current balance Returns current balance
""" """
return self.getQuantity(0.0) + self.getCurrentInventory() return self.getQuantity(0.0) + self.getCurrentInventory()
security.declareProtected(Permissions.View, 'getConsumedBudget') security.declareProtected(Permissions.AccessContentsInformation, 'getConsumedBudget')
def getConsumedBudget(self, src__=0): def getConsumedBudget(self, src__=0):
""" """
Return consumed budget. Return consumed budget.
...@@ -116,14 +116,14 @@ class BudgetCell(Predicate, MetaNode): ...@@ -116,14 +116,14 @@ class BudgetCell(Predicate, MetaNode):
self.getPortalType() self.getPortalType()
return result return result
security.declareProtected(Permissions.View, 'getAvailableBudget') security.declareProtected(Permissions.AccessContentsInformation, 'getAvailableBudget')
def getAvailableBudget(self): def getAvailableBudget(self):
""" """
Return available budget. Return available budget.
""" """
return self.getCurrentBalance() - self.getConsumedBudget() return self.getCurrentBalance() - self.getConsumedBudget()
security.declareProtected(Permissions.View, 'getEngagedBudget') security.declareProtected(Permissions.AccessContentsInformation, 'getEngagedBudget')
def getEngagedBudget(self, src__=0): def getEngagedBudget(self, src__=0):
""" """
Return Engaged budget. Return Engaged budget.
......
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