rcSecurityMan Class Reference

Security Manager class. More...

List of all members.

Public Member Functions

def __init__
 rcSecurityMan constructor.
def readPermissions
 Read permissions from the security.cfg file and update user objects.
def registerPermission
 Register a permission given a role.
def checkPermission
 Checks if the user has been granted the specified permission.
def roleHasPermission
 Check if permission exists in role.
def getPermissions
 Returns the list of all permissions defined.
def getPermissionDescription
 Returns the description for the specified permission.
def getRoles
 Returns the list of all roles defined.
def authenticateUser
 Authenticate the user based on the given login id and password.
def changePassword
 Change an existing user's password.
def addPassword
 Add a new user to the password database.
def checkPassword
 Checks if a user already has a password.
def deleteUser
 Deletes the user based on the given login id and password.
def __makesalt
 private:
def __create
def __check


Detailed Description

Security Manager class.

This class contains user authentication and rights management routines.

Definition at line 30 of file rcSecurityMan.py.


Member Function Documentation

def __check   self,
  data,
  password
 

Definition at line 430 of file rcSecurityMan.py.

def __create   self,
  password
 

Definition at line 423 of file rcSecurityMan.py.

def __init__   self,
  secureDir,
  users
 

rcSecurityMan constructor.

Parameters:
secureDir Directory containing the password and permissions settings
users rcUsers instance

Definition at line 32 of file rcSecurityMan.py.

def __makesalt   self  ) 
 

private:

Definition at line 419 of file rcSecurityMan.py.

def addPassword   self,
  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

Definition at line 274 of file rcSecurityMan.py.

def authenticateUser   self,
  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

Definition at line 171 of file rcSecurityMan.py.

def changePassword   self,
  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

Definition at line 215 of file rcSecurityMan.py.

def checkPassword   self,
  loginId
 

Checks if a user already has a password.

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

Definition at line 326 of file rcSecurityMan.py.

def checkPermission   self,
  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

Definition at line 115 of file rcSecurityMan.py.

def deleteUser   self,
  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

Definition at line 359 of file rcSecurityMan.py.

def getPermissionDescription   self,
  permission
 

Returns the description for the specified permission.

If permission does not exist, returns None.

Parameters:
permission Permission name
Returns:
Permission description string

Definition at line 152 of file rcSecurityMan.py.

def getPermissions   self,
  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

Definition at line 137 of file rcSecurityMan.py.

def getRoles   self  ) 
 

Returns the list of all roles defined.

Returns:
List of all roles.

Definition at line 164 of file rcSecurityMan.py.

def readPermissions   self  ) 
 

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

Definition at line 46 of file rcSecurityMan.py.

def registerPermission   self,
  role,
  permission,
  permDesc
 

Register a permission given a role.

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

Definition at line 94 of file rcSecurityMan.py.

def roleHasPermission   self,
  role,
  permission
 

Check if permission exists in role.

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

Definition at line 126 of file rcSecurityMan.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:53:29 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO