Commit 359837d5 authored by Jérome Perrin's avatar Jérome Perrin

fix bogus security declaration for hasCellContent and improve some docstrings.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8507 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7265d4e5
......@@ -82,10 +82,10 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
# MatrixBox methods
security.declareProtected( Permissions.ModifyPortalContent, 'hasCellContent' )
security.declareProtected( Permissions.AccessContentsInformation,
'hasCellContent' )
def hasCellContent(self, base_id='movement'):
"""
This method can be overriden
"""A cell cannot have cell content itself.
"""
return 0
......
......@@ -154,10 +154,10 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
return aggregate.total_quantity or 0.0
return sum([cell.getQuantity() for cell in self.getCellValueList()])
security.declareProtected(Permissions.View, 'hasCellContent')
security.declareProtected(Permissions.AccessContentsInformation,
'hasCellContent')
def hasCellContent(self, base_id='movement'):
"""
This method can be overriden
"""Return true if the object contains cells.
"""
# Do not use XMLMatrix.hasCellContent, because it can generate
# inconsistency in catalog
......
......@@ -64,10 +64,9 @@ class ProductionReportCell(DeliveryCell):
)
security.declareProtected(Permissions.ModifyPortalContent,
security.declareProtected(Permissions.AccessContentsInformation,
'hasCellContent')
def hasCellContent(self, base_id='movement'):
"""
This method can be overriden
"""A cell cannot have cell content itself.
"""
return 0
......@@ -61,7 +61,8 @@ class XMLMatrix(Folder):
security = ClassSecurityInfo()
# Matrix Methods
security.declareProtected( Permissions.View, 'getCell' )
security.declareProtected( Permissions.AccessContentsInformation,
'getCell' )
def getCell(self, *kw , **kwd):
"""
Access a cell at row and column
......@@ -84,7 +85,8 @@ class XMLMatrix(Folder):
cell_id = '_'.join(cell_id_list)
return self.get(cell_id)
security.declareProtected( Permissions.View, 'getCellProperty' )
security.declareProtected( Permissions.AccessContentsInformation,
'getCellProperty' )
def getCellProperty(self, *kw , **kwd):
"""
Get a property of a cell at row and column
......@@ -96,7 +98,8 @@ class XMLMatrix(Folder):
return cell.getProperty(base_id)
security.declareProtected( Permissions.View, 'hasCell' )
security.declareProtected( Permissions.AccessContentsInformation,
'hasCell' )
def hasCell(self, *kw , **kwd):
"""
Checks if matrix corresponding to base_id contains cell specified
......@@ -123,7 +126,8 @@ class XMLMatrix(Folder):
return self.get(cell_id) is not None
security.declareProtected( Permissions.ModifyPortalContent, 'hasCellContent' )
security.declareProtected( Permissions.AccessContentsInformation,
'hasCellContent' )
def hasCellContent(self, base_id='cell'):
"""
Checks if matrix corresponding to base_id contains cells.
......@@ -142,7 +146,8 @@ class XMLMatrix(Folder):
return 0
security.declareProtected( Permissions.View, 'hasInRange' )
security.declareProtected( Permissions.AccessContentsInformation,
'hasInRange' )
def hasInRange(self, *kw , **kwd):
"""
Checks if *kw coordinates are in the range of the
......
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