Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

rcSecurityMan Class Reference

List of all members.

Public Member Functions

 __init__ (secureDir, users)
 readPermissions ()
 registerPermission (role, permission, permDesc)
 checkPermission (user, permission)
 roleHasPermission (role, permission)
 getPermissions (role=None)
 getPermissionDescription (permission)
 getRoles ()
 authenticateUser (loginId, password)
 changePassword (loginId, password, userName, oldPassword="")
 addPassword (loginId, password, userName)
 checkPassword (loginId)
 deleteUser (loginId)

Detailed Description

Security Manager class that contains user authentication and rights management routines.

Definition at line 18 of file rcSecurityMan.py.


Member Function Documentation

addPassword loginId  ,
password  ,
userName 
 

Add a new user to the password database

Parameters:
loginId User's login id
password The new password for the user
userName User's full name
Returns:
-3: Error accessing the password database -2: User already exists in password database -1: Invalid login or password 0: Added user to the password database

authenticateUser loginId  ,
password 
 

Authenticate the user based on the given login id and password.

Parameters:
loginId User's login id
password User's password
Returns:
-1: User authentication failed, invalid user id or password -2: Password database is not accessible 0: Access granted

changePassword loginId  ,
password  ,
userName  ,
oldPassword  = ""
 

Change an existing user's password.

Parameters:
loginId User's login id
password The new password for the user
userName User's full name
oldPassword User's old password (optional). If this parameter is not specified the old password is not verified. This is useful when the password needs to be reset due to a forgotten password.
Returns:
-1: Invalid login or password -2: Password database is not accessible -3: Error accessing the password database 0: Password changed successfully

checkPassword loginId   ) 
 

Checks if a user already has a password

Parameters:
loginId User's login id
Returns:
-1: Password does not exist 0: Password exists

checkPermission user  ,
permission 
 

Checks if the user has been granted the specified permission

Parameters:
user rcUser object instance
permission Permission name
Returns:
True: If the user is granted the permission False: Otherwise

deleteUser loginId   ) 
 

Deletes the user based on the given login id and password.

Parameters:
loginId User's login id
password User's password
Returns:
-1: User authentication failed, invalid user id or password -2: Password database is not accessible 0: User deleted

getPermissionDescription permission   ) 
 

Returns the description for the specified permission. If permission does not exist, returns None.

Parameters:
permission Permission name
Returns:
Permission description string

getPermissions role  = None  ) 
 

Returns the list of all permissions defined. If role has been specified then returns all permissions defined for that role.

Parameters:
role Role name
Returns:
List of sll permissions or permissions for the specified role

getRoles  ) 
 

Returns the list of all roles defined.

Returns:
List of all roles.

readPermissions  ) 
 

Read permissions from the security.cfg file and update user objects.

registerPermission role  ,
permission  ,
permDesc 
 

Method available to be called by a user script that allows the script to register a permission given a role and update any user permissions who belong in that role

Parameters:
role Role name for the permission to be included.
permission Permission name.
permDesc Permission description

roleHasPermission role  ,
permission 
 

Check if permission exists in role.

Parameters:
role Role name
permission Permission name
Returns:
True: If role has permission. False: otherwise.


The documentation for this class was generated from the following file:
Generated on Fri Jul 21 13:27:53 2006 for LATTE R04-12-00 by doxygen 1.4.3