Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Role Class Reference

Inheritance diagram for Role:

Inheritance graph
[legend]
Collaboration diagram for Role:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Role ($idR)
_GetAllPermissions ()
 _NumUsers ($idR)
 GetId ()
 GetName ()
 SetName ($name)
 Commit ()
 GetPermissions ($idM)
 HasPermission ($name, $idM)
 AddPermission ($name, $idM)
 RemovePermission ($name, $idM)
Create ($name)
 Remove ($idR)
 GetAllRolesId ()

Public Attributes

 $data
 Stores an array with all DB fields for a specific role.

 $perms
 Array with all permissions this role has (indexed by idM).


Detailed Description

Class that abstracts the access to roles information

Definition at line 14 of file Role.class.php.


Constructor & Destructor Documentation

Role::Role idR  ) 
 

Class constructor.

Creates a role object given its id.

Parameters:
idR The id of the role.

Definition at line 26 of file Role.class.php.

Referenced by Create().


Member Function Documentation

& Role::_GetAllPermissions  ) 
 

Gets an array with all permissions this role has.

Returns:
Array of boolean (indexed by idM)

Definition at line 52 of file Role.class.php.

Role::_NumUsers idR  ) 
 

Static method that gets the number of users with this role in any group.

Parameters:
idR The id of the role
Returns:
boolean.

Definition at line 81 of file Role.class.php.

Referenced by Remove().

Role::AddPermission name,
idM
 

Adds a new permission to this role.

Parameters:
name The name of the permission.
idM The id of the module.

Definition at line 178 of file Role.class.php.

References $module, Modules::GetInstance(), and JSystem::IsError().

Role::Commit  ) 
 

Stores all changes in the DB

Definition at line 127 of file Role.class.php.

& Role::Create name  ) 
 

Static method that adds a new role in the system.

Parameters:
name The name of the role.
Returns:
Role.

Definition at line 244 of file Role.class.php.

References JSystem::GetLastError(), JSystem::IsError(), and Role().

Referenced by JUgrSystem::AddRole().

Role::GetAllRolesId  ) 
 

Gets a DBJames object with all the identifiers of the roles.

Returns:
DBJames

Definition at line 302 of file Role.class.php.

Referenced by JUgrSystem::_RefreshRoles().

Role::GetId  ) 
 

Gets the role identifier.

Returns:
integer

Definition at line 98 of file Role.class.php.

Role::GetName  ) 
 

Gets the name of the role.

Returns:
string

Definition at line 107 of file Role.class.php.

Role::GetPermissions idM  ) 
 

Gets an array with al permissions for a module.

Parameters:
idM The id of the module.
Returns:
Array of boolean.

Definition at line 143 of file Role.class.php.

References JBaseObject::RaiseError().

Role::HasPermission name,
idM
 

Checks if the role has a permission for a module.

Parameters:
name The permission name.
idM The module id.
Returns:
boolean

Definition at line 161 of file Role.class.php.

References JBaseObject::RaiseError().

Role::Remove idR  ) 
 

Static method that removes a role from the system.

Parameters:
idR The id of the role.

Definition at line 268 of file Role.class.php.

References _NumUsers(), JSystem::IsError(), and JBaseObject::RaiseError().

Referenced by JUgrSystem::RemoveRole().

Role::RemovePermission name,
idM
 

Removes a permission from the role.

Parameters:
name The name of the permission.
idM The id of the module.

Definition at line 211 of file Role.class.php.

References $module, Modules::GetInstance(), and JSystem::IsError().

Role::SetName name  ) 
 

Sets the name of the role.

The changes will not be stored in the DB until the Commit method is executed.

Parameters:
name The new name of the role.

Definition at line 119 of file Role.class.php.


Member Data Documentation

Role::$data
 

Stores an array with all DB fields for a specific role.

Definition at line 16 of file Role.class.php.

Role::$perms
 

Array with all permissions this role has (indexed by idM).

Definition at line 17 of file Role.class.php.


The documentation for this class was generated from the following file:
Generated on Wed Nov 19 20:29:44 2003 for James by doxygen 1.3.4