Beispiel #1
0
def mutable_properties_plugins(acl_users):
    return dict(
        filter(
            lambda r: IMutablePropertiesPlugin.providedBy(r[1]),
            _plugins(acl_users, PAS.IPropertiesPlugin).items()
            )
        )
Beispiel #2
0
    def testActivateSsouser(self):
        sso = self.uf.manage_addProduct['leocornus.sitesadmin']
        sso.manage_addSsouserPlugins('ssouser')

        plugins = self.uf.plugins

        plugins.activatePlugin(IAuthenticationPlugin, 'ssouser')
        found = plugins._getPlugins(IAuthenticationPlugin)
        self.assertTrue('ssouser' in found)

        plugins.activatePlugin(IUserEnumerationPlugin, 'ssouser')
        found = plugins._getPlugins(IUserEnumerationPlugin)
        self.assertTrue('ssouser' in found)

        plugins.activatePlugin(IUserFactoryPlugin, 'ssouser')
        found = plugins._getPlugins(IUserFactoryPlugin)
        self.assertTrue('ssouser' in found)

        plugins.activatePlugin(IPropertiesPlugin, 'ssouser')
        found = plugins._getPlugins(IPropertiesPlugin)
        self.assertTrue('ssouser' in found)

        plugins.activatePlugin(IExtractionPlugin, 'ssouser')
        found = plugins._getPlugins(IExtractionPlugin)
        self.assertTrue('ssouser' in found)

        plugins.activatePlugin(ICredentialsUpdatePlugin, 'ssouser')
        found = plugins._getPlugins(ICredentialsUpdatePlugin)
        self.assertTrue('ssouser' in found)

        self.failUnless(IMutablePropertiesPlugin.providedBy(self.uf.ssouser))
Beispiel #3
0
    def testLDAPImplements(self):
        klass = PloneLDAPMultiPlugin

        self.assertTrue(IAuthenticationPlugin.implementedBy(klass))
        self.assertTrue(ICredentialsResetPlugin.implementedBy(klass))
        self.assertTrue(IDeleteCapability.implementedBy(klass))
        self.assertTrue(IGroupCapability.implementedBy(klass))
        self.assertTrue(IGroupEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IGroupIntrospection.implementedBy(klass))
        self.assertTrue(IGroupManagement.implementedBy(klass))
        self.assertTrue(IGroupsPlugin.implementedBy(klass))
        self.assertTrue(IMutablePropertiesPlugin.implementedBy(klass))
        self.assertTrue(IPasswordSetCapability.implementedBy(klass))
        self.assertTrue(IPropertiesPlugin.implementedBy(klass))
        self.assertTrue(IRoleEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IRolesPlugin.implementedBy(klass))
        self.assertTrue(IUserAdderPlugin.implementedBy(klass))
        self.assertTrue(IUserEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IUserManagement.implementedBy(klass))
Beispiel #4
0
    def testADImplements(self):
        # The above checks are testing that IF we implement an
        # interface we really DO implement it in practice.  If an
        # interface is not implemented, we are fine with it.  But in
        # this test, we check that some interfaces really are
        # implemented.  This should contain all interfaces that are
        # set with the 'class Implements' directive of the klass.
        klass = PloneActiveDirectoryMultiPlugin

        self.assertTrue(IAuthenticationPlugin.implementedBy(klass))
        self.assertTrue(ICredentialsResetPlugin.implementedBy(klass))
        self.assertTrue(IGroupEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IGroupIntrospection.implementedBy(klass))
        self.assertTrue(IGroupsPlugin.implementedBy(klass))
        self.assertTrue(IMutablePropertiesPlugin.implementedBy(klass))
        self.assertTrue(IPropertiesPlugin.implementedBy(klass))
        self.assertTrue(IRoleEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IRolesPlugin.implementedBy(klass))
        self.assertTrue(IUserEnumerationPlugin.implementedBy(klass))
Beispiel #5
0
    def testLDAPImplements(self):
        klass = PloneLDAPMultiPlugin

        self.assertTrue(IAuthenticationPlugin.implementedBy(klass))
        self.assertTrue(ICredentialsResetPlugin.implementedBy(klass))
        self.assertTrue(IDeleteCapability.implementedBy(klass))
        self.assertTrue(IGroupCapability.implementedBy(klass))
        self.assertTrue(IGroupEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IGroupIntrospection.implementedBy(klass))
        self.assertTrue(IGroupManagement.implementedBy(klass))
        self.assertTrue(IGroupsPlugin.implementedBy(klass))
        self.assertTrue(IMutablePropertiesPlugin.implementedBy(klass))
        self.assertTrue(IPasswordSetCapability.implementedBy(klass))
        self.assertTrue(IPropertiesPlugin.implementedBy(klass))
        self.assertTrue(IRoleEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IRolesPlugin.implementedBy(klass))
        self.assertTrue(IUserAdderPlugin.implementedBy(klass))
        self.assertTrue(IUserEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IUserManagement.implementedBy(klass))
Beispiel #6
0
    def testADImplements(self):
        # The above checks are testing that IF we implement an
        # interface we really DO implement it in practice.  If an
        # interface is not implemented, we are fine with it.  But in
        # this test, we check that some interfaces really are
        # implemented.  This should contain all interfaces that are
        # set with the 'class Implements' directive of the klass.
        klass = PloneActiveDirectoryMultiPlugin

        self.assertTrue(IAuthenticationPlugin.implementedBy(klass))
        self.assertTrue(ICredentialsResetPlugin.implementedBy(klass))
        self.assertTrue(IGroupEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IGroupIntrospection.implementedBy(klass))
        self.assertTrue(IGroupsPlugin.implementedBy(klass))
        self.assertTrue(IMutablePropertiesPlugin.implementedBy(klass))
        self.assertTrue(IPropertiesPlugin.implementedBy(klass))
        self.assertTrue(IRoleEnumerationPlugin.implementedBy(klass))
        self.assertTrue(IRolesPlugin.implementedBy(klass))
        self.assertTrue(IUserEnumerationPlugin.implementedBy(klass))
Beispiel #7
0
 def _testMutableProperties(self, klass):
     if IMutablePropertiesPlugin.implementedBy(klass):
         self.assertTrue(hasattr(klass, 'deleteUser'))
         self.assertTrue(hasattr(klass, 'getPropertiesForUser'))
         self.assertTrue(hasattr(klass, 'setPropertiesForUser'))
Beispiel #8
0
def mutable_properties_plugins(acl_users):
    return dict(
        filter(lambda r: IMutablePropertiesPlugin.providedBy(r[1]),
               _plugins(acl_users, PAS.IPropertiesPlugin).items()))
Beispiel #9
0
 def _testMutableProperties(self, klass):
     if IMutablePropertiesPlugin.implementedBy(klass):
         self.assertTrue(hasattr(klass, 'deleteUser'))
         self.assertTrue(hasattr(klass, 'getPropertiesForUser'))
         self.assertTrue(hasattr(klass, 'setPropertiesForUser'))