def canPasswordSet(self): """True iff user can change password.""" # IUserManagement provides doChangeUser plugins = self._getPlugins() managers = plugins.listPlugins(IUserManagement) for mid, manager in managers: if IPasswordSetCapability.providedBy(manager) and manager.allowPasswordSet(self.getId()): return True return False
def canPasswordSet(self): """True iff user can change password.""" # IUserManagement provides doChangeUser plugins = self._getPlugins() managers = plugins.listPlugins(IUserManagement) for mid, manager in managers: if (IPasswordSetCapability.providedBy(manager) and manager.allowPasswordSet(self.getId())): return True return False
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))
def _testPasswordSetCapability(self, klass): if IPasswordSetCapability.implementedBy(klass): self.assertTrue(hasattr(klass, 'allowPasswordSet'))
def testAllowChangePassword(self): self.failUnless( IPasswordSetCapability.providedBy(self.portal.acl_users.pmm))