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):
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
security.declareProtected(Permissions.View, 'getTitle')
security.declareProtected(Permissions.AccessContentsInformation, 'getTitle')
def getTitle(self):
"""
Return a calculated title.
......@@ -84,7 +84,7 @@ class BudgetCell(Predicate, MetaNode):
self.getPortalType()
return title
security.declareProtected(Permissions.View, 'getCurrentInventory')
security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentInventory')
def getCurrentInventory(self, **kw):
"""
Returns current inventory
......@@ -95,14 +95,14 @@ class BudgetCell(Predicate, MetaNode):
kw['resource'] = resource.getRelativeUrl()
return self.portal_simulation.getCurrentInventory(**kw)
security.declareProtected(Permissions.View, 'getCurrentBalance')
security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentBalance')
def getCurrentBalance(self):
"""
Returns current balance
"""
return self.getQuantity(0.0) + self.getCurrentInventory()
security.declareProtected(Permissions.View, 'getConsumedBudget')
security.declareProtected(Permissions.AccessContentsInformation, 'getConsumedBudget')
def getConsumedBudget(self, src__=0):
"""
Return consumed budget.
......@@ -116,14 +116,14 @@ class BudgetCell(Predicate, MetaNode):
self.getPortalType()
return result
security.declareProtected(Permissions.View, 'getAvailableBudget')
security.declareProtected(Permissions.AccessContentsInformation, 'getAvailableBudget')
def getAvailableBudget(self):
"""
Return available budget.
"""
return self.getCurrentBalance() - self.getConsumedBudget()
security.declareProtected(Permissions.View, 'getEngagedBudget')
security.declareProtected(Permissions.AccessContentsInformation, 'getEngagedBudget')
def getEngagedBudget(self, src__=0):
"""
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