Stud.IP  2.5 Revision
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()

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()

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()

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()

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()

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()

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()

getAllRoles ( )

Enter description here...

Returns
array Roles
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAssignedPluginRoles()

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()

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:
Here is the caller graph for this function:

◆ isAssignedRole()

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:
Here is the caller graph for this function:

◆ saveRole()

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

◆ ROLES_CACHE_KEY

const ROLES_CACHE_KEY = 'plugins/rolepersistence/roles'

◆ ROLES_PLUGINS_CACHE_KEY

const ROLES_PLUGINS_CACHE_KEY = 'plugins/rolepersistence/roles_plugins/'

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