Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
PlonePAS.plugins.user.UserManager Class Reference
Inheritance diagram for PlonePAS.plugins.user.UserManager:
Inheritance graph
[legend]
Collaboration diagram for PlonePAS.plugins.user.UserManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def addUser
def doDeleteUser
 User Management interface.
def doChangeUser
def allowDeletePrincipal
def allowPasswordSet
def getUserIds
 User Introspection interface.
def getUserNames
def getUsers

Static Public Attributes

string meta_type = 'User Manager'
tuple security = ClassSecurityInfo()

Detailed Description

PAS plugin for managing users. (adds write API)

Definition at line 48 of file user.py.


Member Function Documentation

def PlonePAS.plugins.user.UserManager.addUser (   self,
  user_id,
  login_name,
  password 
)
Original ZODBUserManager.addUser, modified to check if
incoming password is already encypted.

This support clean migration from default user source.
Should go into PAS.

Definition at line 55 of file user.py.

00055 
00056     def addUser(self, user_id, login_name, password):
00057         """Original ZODBUserManager.addUser, modified to check if
00058         incoming password is already encypted.
00059 
00060         This support clean migration from default user source.
00061         Should go into PAS.
00062         """
00063         if self._user_passwords.get(user_id) is not None:
00064             raise KeyError, 'Duplicate user ID: %s' % user_id
00065 
00066         if self._login_to_userid.get(login_name) is not None:
00067             raise KeyError, 'Duplicate login name: %s' % login_name
00068 
00069         if not AuthEncoding.is_encrypted(password):
00070             password = AuthEncoding.pw_encrypt(password)
00071         self._user_passwords[ user_id ] = password
00072         self._login_to_userid[ login_name ] = user_id
00073         self._userid_to_login[ user_id ] = login_name
00074 
00075         # enumerateUsers return value has changed
00076         view_name = createViewName('enumerateUsers')
00077         self.ZCacheable_invalidate(view_name=view_name)

Here is the call graph for this function:

Here is the caller graph for this function:

def PlonePAS.plugins.user.UserManager.allowDeletePrincipal (   self,
  principal_id 
)
True iff this plugin can delete a certain user/group.
This is true if this plugin manages the user.

Definition at line 97 of file user.py.

00097 
00098     def allowDeletePrincipal(self, principal_id):
00099         """True iff this plugin can delete a certain user/group.
00100         This is true if this plugin manages the user.
00101         """
00102         if self._user_passwords.get(principal_id) is not None:
00103             return 1
00104         return 0

Here is the caller graph for this function:

def PlonePAS.plugins.user.UserManager.allowPasswordSet (   self,
  principal_id 
)
True iff this plugin can set the password a certain user.
This is true if this plugin manages the user.

Definition at line 106 of file user.py.

00106 
00107     def allowPasswordSet(self, principal_id):
00108         """True iff this plugin can set the password a certain user.
00109         This is true if this plugin manages the user.
00110         """
00111         return self.allowDeletePrincipal(principal_id)

Here is the call graph for this function:

def PlonePAS.plugins.user.UserManager.doChangeUser (   self,
  principal_id,
  password 
)
Change a user's password

Definition at line 87 of file user.py.

00087 
00088     def doChangeUser(self, principal_id, password):
00089         """Change a user's password
00090         """
00091         if self._user_passwords.get(principal_id) is None:
00092             raise RuntimeError, "User does not exist: %s" % principal_id
00093         self._user_passwords[principal_id] = AuthEncoding.pw_encrypt(password)

def PlonePAS.plugins.user.UserManager.doDeleteUser (   self,
  userid 
)

User Management interface.

Given a user id, delete that user

Definition at line 81 of file user.py.

00081 
00082     def doDeleteUser(self, userid):
00083         """Given a user id, delete that user
00084         """
00085         return self.removeUser(userid)

Here is the call graph for this function:

User Introspection interface.

Return a list of user ids

Definition at line 114 of file user.py.

00114 
00115     def getUserIds(self):
00116         """
00117         Return a list of user ids
00118         """
00119         return self.listUserIds()

Here is the call graph for this function:

Here is the caller graph for this function:

Return a list of usernames

Definition at line 120 of file user.py.

00120 
00121     def getUserNames(self):
00122         """
00123         Return a list of usernames
00124         """
00125         return [x['login_name'] for x in self.listUserInfo()]

Here is the call graph for this function:

Return a list of users

Definition at line 126 of file user.py.

00126 
00127     def getUsers(self):
00128         """
00129         Return a list of users
00130         """
00131         uf = self.acl_users
00132         return [uf.getUserById(x) for x in self.getUserIds()]
00133 
00134 classImplements(UserManager,
00135                 IUserManagement, IUserIntrospection,
00136                 IDeleteCapability, IPasswordSetCapability,
00137                 *implementedBy(BasePlugin))
00138 
00139 InitializeClass(UserManager)

Here is the call graph for this function:


Member Data Documentation

string PlonePAS.plugins.user.UserManager.meta_type = 'User Manager' [static]

Definition at line 52 of file user.py.

tuple PlonePAS.plugins.user.UserManager.security = ClassSecurityInfo() [static]

Definition at line 53 of file user.py.


The documentation for this class was generated from the following file: