Ejemplo n.º 1
0
 def canDelete(self):
     """True iff user can be removed from the Plone UI."""
     # IUserManagement provides doDeleteUser
     plugins = self._getPlugins()
     managers = plugins.listPlugins(IUserManagement)
     for mid, manager in managers:
         if IDeleteCapability.providedBy(manager) and manager.allowDeletePrincipal(self.getId()):
             return True
     return False
Ejemplo n.º 2
0
 def canDelete(self):
     """True iff user can be removed from the Plone UI."""
     # IUserManagement provides doDeleteUser
     plugins = self._getPlugins()
     managers = plugins.listPlugins(IUserManagement)
     for mid, manager in managers:
         if (IDeleteCapability.providedBy(manager) and
                 manager.allowDeletePrincipal(self.getId())):
             return True
     return False
Ejemplo n.º 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))
Ejemplo n.º 4
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))
Ejemplo n.º 5
0
 def _testDeleteCapability(self, klass):
     if IDeleteCapability.implementedBy(klass):
         self.assertTrue(hasattr(klass, 'allowDeletePrincipal'))
Ejemplo n.º 6
0
 def _testDeleteCapability(self, klass):
     if IDeleteCapability.implementedBy(klass):
         self.assertTrue(hasattr(klass, 'allowDeletePrincipal'))