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