Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
RolePersistence Class Reference
Collaboration diagram for RolePersistence:
Collaboration graph

Public Member Functions

 getAllRoles ()
 saveRole ($role)
 deleteRole ($role)
 assignRole ($user, $role)
 getAssignedRoles ($userid, $implicit=false)
 deleteRoleAssignment ($user, $role)
 getAllRoleAssignments ($user=null)
 assignPluginRoles ($pluginid, $roleids)
 deleteAssignedPluginRoles ($pluginid, $roleids)
 getAssignedPluginRoles ($pluginid=-1)

Static Public Member Functions

static isAssignedRole ($userid, $assignedrole)

Data Fields

const ROLES_CACHE_KEY = 'plugins/rolepersistence/roles'
const ROLES_PLUGINS_CACHE_KEY = 'plugins/rolepersistence/roles_plugins/'

Detailed Description

Funktionen für das Rollenmanagement TODO: (mriehe) this is a static class, change the public function in static public functions

Member Function Documentation

assignPluginRoles (   $pluginid,
  $roleids 
)

Enter description here...

Parameters
int$pluginid
array$roleids

Here is the call graph for this function:

Here is the caller graph for this function:

assignRole (   $user,
  $role 
)

Saves a role assignment to the database

Parameters
StudIPUser$user
Role$role

Here is the call graph for this function:

Here is the caller graph for this function:

deleteAssignedPluginRoles (   $pluginid,
  $roleids 
)

Enter description here...

Parameters
int$pluginid
array$roleids

Here is the call graph for this function:

Here is the caller graph for this function:

deleteRole (   $role)

Delete role if not a permanent role. System roles cannot be deleted.

Parameters
unknown_type$role

Here is the call graph for this function:

Here is the caller graph for this function:

deleteRoleAssignment (   $user,
  $role 
)

Deletes a role assignment from the database

Parameters
StudIPUser[]$users
Role$role

Here is the call graph for this function:

Here is the caller graph for this function:

getAllRoleAssignments (   $user = null)

Get's all Role-Assignments for a certain user. If no user is set, all role assignments are returned.

Parameters
StudIPUser$user
Returns
array with roleids and the assigned userids

Here is the call graph for this function:

getAllRoles ( )

Enter description here...

Returns
array Roles

Here is the call graph for this function:

Here is the caller graph for this function:

getAssignedPluginRoles (   $pluginid = -1)

Enter description here...

Parameters
int$pluginid
Returns
array

Here is the call graph for this function:

Here is the caller graph for this function:

getAssignedRoles (   $userid,
  $implicit = false 
)

Gets all assigned roles from the database for a user

Parameters
int$userid
boolean$implicit
Returns
array

Here is the call graph for this function:

static isAssignedRole (   $userid,
  $assignedrole 
)
static

Checks a role assignment for an user

Parameters
string$userid
string$assignedrole
Returns
boolean

Here is the call graph for this function:

saveRole (   $role)

Inserts the role into the database or does an update, if it's already there

Parameters
Role$role
Returns
the role id

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

const ROLES_CACHE_KEY = 'plugins/rolepersistence/roles'
const ROLES_PLUGINS_CACHE_KEY = 'plugins/rolepersistence/roles_plugins/'

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