Commit 5267bbf0 authored by Jean-Paul Smets's avatar Jean-Paul Smets

support for ERP5Security - name fix


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4173 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9ff8dd63
...@@ -190,4 +190,4 @@ portal_default_gap_root = 'gap/france/pcg' ...@@ -190,4 +190,4 @@ portal_default_gap_root = 'gap/france/pcg'
# Security default values: a list of base categories which security groups are based on # Security default values: a list of base categories which security groups are based on
# WARNING: order must be consistent with Portal Types Roles Definitions. # WARNING: order must be consistent with Portal Types Roles Definitions.
portal_assignments_base_categoty_list = ['site', 'group', 'function'] portal_assignment_base_category_list = ['site', 'group', 'function']
...@@ -521,6 +521,12 @@ class ERP5Site ( CMFSite, FolderMixIn ): ...@@ -521,6 +521,12 @@ class ERP5Site ( CMFSite, FolderMixIn ):
Return accounting movement type list. Return accounting movement type list.
""" """
return self._getPortalConfiguration('portal_accounting_movement_type_list') return self._getPortalConfiguration('portal_accounting_movement_type_list')
def getPortalAssignmentBaseCategoryList(self):
"""
Return List of category values to generate security groups.
"""
return self._getPortalConfiguration('portal_assignment_base_category_list')
security.declareProtected(Permissions.AccessContentsInformation, 'getDefaultModuleId') security.declareProtected(Permissions.AccessContentsInformation, 'getDefaultModuleId')
def getDefaultModuleId(self, portal_type): def getDefaultModuleId(self, portal_type):
...@@ -829,11 +835,28 @@ class ERP5Generator(PortalGenerator): ...@@ -829,11 +835,28 @@ class ERP5Generator(PortalGenerator):
skins_tool["erp5_core"].ERP5Site_reindexAll() skins_tool["erp5_core"].ERP5Site_reindexAll()
def setupUserFolder(self, p): def setupUserFolder(self, p):
# We use if possible ERP5Security, then NuxUserGroups
try: try:
# Use NuxUserGroups instead of the standard acl_users. import Products.ERP5Security
except ImportError:
ERP5Security = None
try:
import Products.NuxUserGroups
withnuxgroups = 1
except:
withnuxgroups = 0
if ERP5Security is not None
# Use Pluggable Auth Service instead of the standard acl_users.
p.manage_addProduct['PluggableAuthService'].addPluggableAuthService()
# Add ERP5UserManager
p.acl_users.manage_addProduct['ERP5Security'].addERP5UserManager('erp5_users')
p.acl_users.manage_addProduct['ERP5Security'].addERP5GroupManager('erp5_groups')
p.acl_users.manage_addProduct['ERP5Security'].addERP5RoleManager('erp5_roles')
elif withnuxgroups:
# NuxUserGroups user folder
p.manage_addProduct['NuxUserGroups'].addUserFolderWithGroups() p.manage_addProduct['NuxUserGroups'].addUserFolderWithGroups()
except KeyError: else:
# No way. # Standard user folder
PortalGenerator.setupUserFolder(self, p) PortalGenerator.setupUserFolder(self, p)
def setupPermissions(self, p): def setupPermissions(self, p):
......
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