Change security on the method (initializeGenerator and clearGenerator)

Remove useless comment


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34614 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7117f5aa
...@@ -101,7 +101,7 @@ class IdTool(BaseTool): ...@@ -101,7 +101,7 @@ class IdTool(BaseTool):
return id_last_generator return id_last_generator
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getLatestVersionValue') 'getLatestGeneratorValue')
def _getLatestGeneratorValue(self, id_generator): def _getLatestGeneratorValue(self, id_generator):
""" """
Return the last generator with the reference Return the last generator with the reference
...@@ -244,7 +244,7 @@ class IdTool(BaseTool): ...@@ -244,7 +244,7 @@ class IdTool(BaseTool):
new_id_list = range(new_id - id_count, new_id) new_id_list = range(new_id - id_count, new_id)
return new_id_list return new_id_list
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.ModifyPortalContent,
'initializeGenerator') 'initializeGenerator')
def initializeGenerator(self, id_generator=None, all=False): def initializeGenerator(self, id_generator=None, all=False):
""" """
...@@ -263,7 +263,7 @@ class IdTool(BaseTool): ...@@ -263,7 +263,7 @@ class IdTool(BaseTool):
portal_type='Application Id Generator'): portal_type='Application Id Generator'):
generator.initializeGenerator() generator.initializeGenerator()
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.ModifyPortalContent,
'clearGenerator') 'clearGenerator')
def clearGenerator(self, id_generator=None, all=False): def clearGenerator(self, id_generator=None, all=False):
""" """
...@@ -294,7 +294,6 @@ class IdTool(BaseTool): ...@@ -294,7 +294,6 @@ class IdTool(BaseTool):
#backward compatibility #backward compatibility
generateNewLengthIdList = generateNewIdList generateNewLengthIdList = generateNewIdList
#use by alarm
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getLastLengthGeneratedId') 'getLastLengthGeneratedId')
def getLastLengthGeneratedId(self, id_group, default=None): def getLastLengthGeneratedId(self, id_group, default=None):
...@@ -328,7 +327,6 @@ class IdTool(BaseTool): ...@@ -328,7 +327,6 @@ class IdTool(BaseTool):
return result[0]['LAST_INSERT_ID()'] return result[0]['LAST_INSERT_ID()']
return default return default
#use in erp5_accounting
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getLastGeneratedId') 'getLastGeneratedId')
def getLastGeneratedId(self, id_group=None, default=None): def getLastGeneratedId(self, id_group=None, default=None):
...@@ -344,7 +342,6 @@ class IdTool(BaseTool): ...@@ -344,7 +342,6 @@ class IdTool(BaseTool):
last_id = self.dict_ids.get(id_group, default) last_id = self.dict_ids.get(id_group, default)
return last_id return last_id
#use in the unit tests
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'setLastGeneratedId') 'setLastGeneratedId')
def setLastGeneratedId(self, new_id, id_group=None): def setLastGeneratedId(self, new_id, id_group=None):
...@@ -357,7 +354,6 @@ class IdTool(BaseTool): ...@@ -357,7 +354,6 @@ class IdTool(BaseTool):
if id_group is not None and id_group != 'None': if id_group is not None and id_group != 'None':
self.dict_ids[id_group] = new_id self.dict_ids[id_group] = new_id
# use several files
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'generateNewLengthId') 'generateNewLengthId')
def generateNewLengthId(self, id_group=None, default=None, store=1): def generateNewLengthId(self, id_group=None, default=None, store=1):
......
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