Commit 3eaa8114 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: project's codification is used to generate the local roles

parent 68efafa0
...@@ -14,15 +14,15 @@ else: ...@@ -14,15 +14,15 @@ else:
if project is None: if project is None:
return None return None
project_reference = project.getReference() project_codification = project.getCodification()
member = portal.portal_membership.getAuthenticatedMember() member = portal.portal_membership.getAuthenticatedMember()
getGroups = getattr(member, 'getGroups', None) getGroups = getattr(member, 'getGroups', None)
if getGroups is not None: if getGroups is not None:
user_group_list = getGroups() user_group_list = getGroups()
return (project.getValidationState() == 'validated') and ( return (project.getValidationState() == 'validated') and (
((manager) and ('%s_F-PRODMAN' % project_reference in user_group_list)) or ((manager) and ('%s_F-PRODMAN' % project_codification in user_group_list)) or
((agent) and ('%s_F-PRODAGNT' % project_reference in user_group_list)) or ((agent) and ('%s_F-PRODAGNT' % project_codification in user_group_list)) or
((customer) and ('%s_F-CUSTOMER' % project_reference in user_group_list)) ((customer) and ('%s_F-CUSTOMER' % project_codification in user_group_list))
) )
return False return False
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