Commit 844340b2 authored by Fabien Morin's avatar Fabien Morin

remove setUpEGovPas. Now it's an external method in project bt.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23217 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1151f25b
...@@ -89,7 +89,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -89,7 +89,6 @@ class TestEGovMixin(SecurityTestCase):
message.method_id) message.method_id)
self.createUsers() self.createUsers()
self.createOrganisations() self.createOrganisations()
self.setUpEGovPas()
# XXX quick hack not to have mysql database pre-fill. # XXX quick hack not to have mysql database pre-fill.
self.portal.__class__.DeclarationTVA_zGetSIGTASInformation \ self.portal.__class__.DeclarationTVA_zGetSIGTASInformation \
...@@ -191,48 +190,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -191,48 +190,6 @@ class TestEGovMixin(SecurityTestCase):
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
def setUpEGovPas(self):
'''use safi PAS to be able to login organisation'''
from Products import ERP5Security
from Products import PluggableAuthService
portal = self.getPortalObject()
acl_users = self.getUserFolder()
# Add SAFIUserManager
ZopeTestCase.installProduct('SAFISecurity')
erp5security_dispatcher = acl_users.manage_addProduct['SAFISecurity']
# don't add it if it's already here
if {'meta_type': 'SAFI User Manager', 'id': 'safi_users'} not in \
erp5security_dispatcher._d._objects:
erp5security_dispatcher.addSAFIUserManager('safi_users')
if {'meta_type': 'SAFI Group Manager', 'id': 'safi_groups'} not in \
erp5security_dispatcher._d._objects :
erp5security_dispatcher.addSAFIGroupManager('safi_groups')
# Register ERP5UserManager Interface
acl_users.safi_users.manage_activateInterfaces(('IAuthenticationPlugin',
'IUserEnumerationPlugin',))
acl_users.safi_groups.manage_activateInterfaces(('IGroupsPlugin',))
# desactivate the erp5 plugin
plugins = acl_users.safi_groups.plugins
interface = plugins._getInterfaceFromName('IGroupsPlugin')
if 'erp5_groups' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_groups')
plugins = acl_users.safi_users.plugins
interface = plugins._getInterfaceFromName('IAuthenticationPlugin')
if 'erp5_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_users')
interface = plugins._getInterfaceFromName('IUserEnumerationPlugin')
if 'erp5_users' in list(plugins._getPlugins(interface)):
plugins.deactivatePlugin( interface, 'erp5_users')
# set properties to enable the login on Person and Organisation
acl_users.safi_users.manage_changeProperties(portal_type_list=['Person',
'Organisation'],)
acl_users.safi_groups.manage_changeProperties(portal_type_list=['Person',
'Organisation'],)
def checkRights(self, object_list, security_mapping, username): def checkRights(self, object_list, security_mapping, username):
self.loginAsUser(username) self.loginAsUser(username)
user = getSecurityManager().getUser() user = getSecurityManager().getUser()
......
244 250
\ 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