| |
- UserKit.User.User(__builtin__.object)
-
- RoleUser
class RoleUser(UserKit.User.User) |
|
RoleUser, in conjunction with Role, provides for role-based users and security.
See the doc for playsRole() for an example.
Note that this class plays nicely with both Role and HierRole. e.g., no "HierRoleUser" is needed when making use of HierRoles.
See also:
* class Role
* class HierRole |
|
- Method resolution order:
- RoleUser
- UserKit.User.User
- __builtin__.object
Methods defined here:
- __init__(self, manager=None, name=None, password=None)
- addRoles(self, listOfRoles)
- Adds additional roles for the user. Each role in the list may be a valid role name or a Role object.
- playsRole(self, roleOrName)
- Returns 1 if the user plays the given role. More specifically, if any of the user's roles return true for role.playsRole(otherRole), this method returns true.
The application of this popular method often looks like this:
if user.playsRole('admin'):
displayAdminMenuItems()
- roles(self)
- Returns a direct list of the user's roles. Do not modify.
- setRoles(self, listOfRoles)
- Sets all the roles for the user. Each role in the list may be a valid role name or a Role object.
Implementation note: depends on addRoles().
Methods inherited from UserKit.User.User:
- creationTime(self)
- externalId(self)
- isActive(self)
- lastAccessTime(self)
- lastLoginTime(self)
- login(self, password, fromMgr=0)
- Returns self if the login is successful and None otherwise.
- logout(self, fromMgr=0)
- manager(self)
- name(self)
- password(self)
- serialNum(self)
- setManager(self, manager)
- Sets the manager, which can only be done once.
- setName(self, name)
- Sets the name, which can only be done once.
- setPassword(self, password)
- wasAccessed(self)
Data and other attributes inherited from UserKit.User.User:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'User' objects>
- list of weak references to the object (if defined)
| |