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