Commit 9b4796d7 authored by Mohamadou Mbengue's avatar Mohamadou Mbengue

* clean EGov_security Extension

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36726 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ab0fb3e
...@@ -127,17 +127,18 @@ def setPermissionsOnEGovModule(self, portal_type_object): ...@@ -127,17 +127,18 @@ def setPermissionsOnEGovModule(self, portal_type_object):
'WebDAV access', 'WebDAV access',
] ]
agent_permission_list = [Permissions.AccessContentsInformation, Permissions.AddPortalContent \
,Permissions.CopyOrMove, Permissions.ModifyPortalContent \
,Permissions.ListFolderContents,Permissions.View, 'View History' \
]
view_permission_list= [ Permissions.AccessContentsInformation, Permissions.ListFolderContents \ view_permission_list= [ Permissions.AccessContentsInformation, Permissions.ListFolderContents \
, Permissions.View ] , Permissions.View ]
role_permission_dict = {'Anonymous':[Permissions.AccessContentsInformation, Permissions.AddPortalContent \ citizen_role_list = ['role/citoyen', 'role/citoyen/national', 'role/citoyen/etranger']
,Permissions.CopyOrMove, Permissions.ModifyPortalContent \ company_role_list = ['role/entreprise', 'role/entreprise/agence', 'role/entreprise/siege', 'role/entreprise/succursale']
,Permissions.ListFolderContents,Permissions.View, 'View History' \ agent_role_list = ['role/gouvernement']
],
'Agent': [Permissions.AccessContentsInformation, Permissions.AddPortalContent \ role_permission_dict = {'Agent': agent_permission_list,
,Permissions.CopyOrMove, Permissions.ModifyPortalContent \
,Permissions.ListFolderContents,Permissions.View, 'View History' \
],
'Associate':[Permissions.AccessContentsInformation, Permissions.ListFolderContents \ 'Associate':[Permissions.AccessContentsInformation, Permissions.ListFolderContents \
,Permissions.View, Permissions.CopyOrMove, 'View History' \ ,Permissions.View, Permissions.CopyOrMove, 'View History' \
], ],
...@@ -155,23 +156,26 @@ def setPermissionsOnEGovModule(self, portal_type_object): ...@@ -155,23 +156,26 @@ def setPermissionsOnEGovModule(self, portal_type_object):
'Manager': zope_permission_list 'Manager': zope_permission_list
} }
#XXX if the procedure needs no authentification, #set acquired local role on the portal type
# assume anonymous role can access and add portal_type_object.setTypeAcquireLocalRole(1)
#Agent role should have access permissions on the portal type
portal_type_object.manage_role(role_to_manage='Agent', permissions=view_permission_list)
# if the procedure needs no authentification anonymous should access and add
if portal_type_object is not None: if portal_type_object is not None:
step_authentication = portal_type_object.getStepAuthentication() step_authentication = portal_type_object.getStepAuthentication()
step_subscription = portal_type_object.getStepSubscription() step_subscription = portal_type_object.getStepSubscription()
if not step_authentication: # and not step_subscription
#Anonymous should have access, add, modify and delete permissions on the module
self.manage_role(role_to_manage='Anonymous', permissions=agent_permission_list)
#Anonymous should also have access to the portal type
portal_type_object.manage_role(role_to_manage='Anonymous', permissions=view_permission_list)
#set acquired permissionson the module
self.manage_acquiredPermissions(aquired_permission_list) self.manage_acquiredPermissions(aquired_permission_list)
for (role, permission_list) in role_permission_dict.items(): for (role, permission_list) in role_permission_dict.items():
if role == "Anonymous" and not step_authentication and not step_subscription:
self.manage_role(role_to_manage=role, permissions=permission_list) self.manage_role(role_to_manage=role, permissions=permission_list)
#give anonymous access to the portal type
portal_type_object.manage_role(role_to_manage=role, permissions=view_permission_list)
elif role != "Anonymous":
self.manage_role(role_to_manage=role, permissions=permission_list)
if role == "Agent":
portal_type_object.manage_role(role_to_manage=role, permissions=permission_list)
#set acquired local role on the portal type
portal_type_object.setTypeAcquireLocalRole(1)
def getSecurityCategoryFromAssignment(self, base_category_list, user_name, def getSecurityCategoryFromAssignment(self, base_category_list, user_name,
object, portal_type, child_category_list=[]): object, portal_type, child_category_list=[]):
......
2010-06-30 mohamadou
* clean EGov_security Extension
2010-06-29 mohamadou 2010-06-29 mohamadou
* Add erp5_egov_security skin folder * Add erp5_egov_security skin folder
......
660 662
\ No newline at end of file \ No newline at end of file
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