Commit 4f382f0d authored by Jérome Perrin's avatar Jérome Perrin

Rename assignRoleToSecurityGroup to updateLocalRolesOnSecurityGroups, and...

Rename assignRoleToSecurityGroup to updateLocalRolesOnSecurityGroups, and change the security to 'Change local roles'.
Old assignRoleToSecurityGroup still exists with 'Modify portal content' security.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9153 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f4502b1f
......@@ -2223,13 +2223,27 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
return None
return None
security.declareProtected(Permissions.ModifyPortalContent,'assignRoleToSecurityGroup')
def assignRoleToSecurityGroup(self, **kw):
"""
Set or reset local roles assignments based on local roles
definition in portal type.
security.declareProtected(Permissions.ChangeLocalRoles,
'updateLocalRolesOnSecurityGroups')
def updateLocalRolesOnSecurityGroups(self, **kw):
"""Assign Local Roles to Groups on self, based on Portal Type Role
Definitions and "ERP5 Role Definition" objects contained inside self.
"""
self._getTypesTool()[self.getPortalType()].assignRoleToSecurityGroup(self, **kw)
self._getTypesTool().getTypeInfo(self)\
.updateLocalRolesOnSecurityGroups(self, **kw)
security.declareProtected(Permissions.ModifyPortalContent,
'assignRoleToSecurityGroup')
def assignRoleToSecurityGroup(self, **kw):
"""This is basically the same as `updateLocalRolesOnSecurityGroups`, but
with a different permission.
"""
warnings.warn('assignRoleToSecurityGroup is a deprecated alias to '
'updateLocalRolesOnSecurityGroups. Please note that the '
'permission changed to "Change Local Roles".',
DeprecationWarning)
self.updateLocalRolesOnSecurityGroups(**kw)
# Template Management
security.declareProtected(Permissions.View, 'getDocumentTemplateList')
......
......@@ -354,12 +354,11 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase, Translation
id = id + "d"
return factory_method(portal, id).propertyMap()
security.declareProtected(ERP5Permissions.ModifyPortalContent,
'assignRoleToSecurityGroup')
def assignRoleToSecurityGroup(self, ob, user_name = None):
security.declarePrivate('updateLocalRolesOnSecurityGroups')
def updateLocalRolesOnSecurityGroups(self, ob, user_name = None):
"""
Assign Local Roles to Groups on object, based on Portal Type
Role Definitions
Assign Local Roles to Groups on object 'ob', based on Portal Type Role
Definitions and "ERP5 Role Definition" objects contained inside 'ob'.
"""
#FIXME We should check the type of the acl_users folder instead of
# checking which product is installed.
......@@ -518,6 +517,11 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase, Translation
ob.manage_addLocalGroupRoles(group, role_list)
ob.manage_addLocalRoles(group, role_list)
# XXX compat. alias
security.declareProtected(Permissions.ModifyPortalContent,
'assignRoleToSecurityGroup')
assignRoleToSecurityGroup = updateLocalRolesOnSecurityGroups
security.declarePublic('getFilteredRoleListFor')
def getFilteredRoleListFor(self, ob=None, **kw):
"""
......
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