Commit 5ae11aeb authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Vincent Pelletier

ERP5Site: register ERP5 Login authentication plugin on creation.

parent 5ec2a55d
......@@ -129,9 +129,13 @@ def setUpEGovSecurityManager(self):
interface = plugins._getInterfaceFromName('IAuthenticationPlugin')
if 'erp5_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_users')
if 'erp5_login_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_login_users')
interface = plugins._getInterfaceFromName('IUserEnumerationPlugin')
if 'erp5_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_users')
if 'erp5_login_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_login_users')
# set properties to enable the login on Person and Organisation
# and subcription forms (citizen, company, agent)
......
......@@ -5,7 +5,7 @@ plugin_id = "nexedi_authentication"
user_folder = context.getPortalObject().acl_users
user_folder.manage_delObjects('nexedi_authentication')
erp5_users_plugin = getattr(user_folder, "erp5_users")
erp5_users_plugin.manage_activateInterfaces(interfaces=['IAuthenticationPlugin', 'IUserEnumerationPlugin'])
erp5_login_users_plugin = getattr(user_folder, "erp5_login_users")
erp5_login_users_plugin.manage_activateInterfaces(interfaces=['IAuthenticationPlugin', 'IUserEnumerationPlugin'])
return True
......@@ -2151,14 +2151,14 @@ class ERP5Generator(PortalGenerator):
'IRoleAssignerPlugin'))
# Add ERP5UserManager
erp5security_dispatcher = p.acl_users.manage_addProduct['ERP5Security']
erp5security_dispatcher.addERP5UserManager('erp5_users')
erp5security_dispatcher.addERP5LoginUserManager('erp5_login_users')
erp5security_dispatcher.addERP5GroupManager('erp5_groups')
erp5security_dispatcher.addERP5RoleManager('erp5_roles')
erp5security_dispatcher.addERP5UserFactory('erp5_user_factory')
erp5security_dispatcher.addERP5DumbHTTPExtractionPlugin(
'erp5_dumb_http_extraction')
# Register ERP5UserManager Interface
p.acl_users.erp5_users.manage_activateInterfaces(
p.acl_users.erp5_login_users.manage_activateInterfaces(
('IAuthenticationPlugin',
'IUserEnumerationPlugin',))
p.acl_users.erp5_groups.manage_activateInterfaces(('IGroupsPlugin',))
......
......@@ -107,9 +107,8 @@ class TestERP5RemoteUserManager(ERP5TypeTestCase):
acl_users = self.portal.acl_users
addERP5RemoteUserManager(acl_users, self.erp5_remote_manager_id)
self.erp5_remote_manager = getattr(acl_users, self.erp5_remote_manager_id)
erp5_users = getattr(acl_users, 'erp5_users')
erp5_users.manage_activateInterfaces(['IUserEnumerationPlugin'])
self.erp5_remote_manager.manage_activateInterfaces(['IAuthenticationPlugin'])
acl_users.erp5_login_users.manage_activateInterfaces([])
self.erp5_remote_manager.manage_activateInterfaces(['IAuthenticationPlugin', 'IUserEnumerationPlugin'])
self.commit()
def afterSetUp(self):
......
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