Stud.IP  4.0 Revision
MvvPerm Class Reference
Collaboration diagram for MvvPerm:
Collaboration graph

Public Member Functions

 __construct (ModuleManagementModel $mvv_object)
 
 __call ($name, $arguments)
 
 setVariant ($variant)
 
 havePerm ($perm, $status=null, $user_id=null, $institut_id=null)
 
 haveObjectPerm ($perm, $user_id=null)
 
 haveDfEntryPerm ($df_entry, $perm)
 
 getFieldPerm ($field, $user_id=null, $institut_id=null)
 
 haveFieldPerm ($field, $perm=null, $user_id=null, $institut_id=null)
 
 disable ($field, $perm=null, $user_id=null, $institut_id=null)
 

Static Public Member Functions

static get ($mvv_object)
 
static __callStatic ($name, $arguments)
 
static getPerm ($object, $status=null, $user_id=null, $institut_id=null, $variant=null)
 
static getRoles ($user_id)
 
static refreshPrivileges ($mvv_table)
 
static getOwnInstitutes ($user_id=null, $mvv_roles=null)
 

Data Fields

const PERM_READ = 1
 
const PERM_WRITE = 3
 
const PERM_CREATE = 7
 
const PERM_ADMIN = 15
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( ModuleManagementModel  $mvv_object)

Member Function Documentation

◆ __call()

__call (   $name,
  $arguments 
)
Here is the call graph for this function:

◆ __callStatic()

static __callStatic (   $name,
  $arguments 
)
static
Here is the call graph for this function:

◆ disable()

disable (   $field,
  $perm = null,
  $user_id = null,
  $institut_id = null 
)
Here is the call graph for this function:

◆ get()

static get (   $mvv_object)
static
Here is the caller graph for this function:

◆ getFieldPerm()

getFieldPerm (   $field,
  $user_id = null,
  $institut_id = null 
)
final

Retrieves the permission for the table or object. Returns the (max) perm the given or current user have globally. If the institute is set, checks for the perm in the context of this institute.

Parameters
string|arrayName of field or an array with name of field and related entry (usefull in the case of relations to datafields).
string$user_idThe ID of the user. If not set the ID of the current user.
string$institut_idThe ID of an institute if the user role is defined for institutes.
Returns
int The perm defined in class MVVPlugin.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOwnInstitutes()

static getOwnInstitutes (   $user_id = null,
  $mvv_roles = null 
)
static

Returns all ids of institutes the user is assigned with at least one role. Have the user at least one role globally an empty array is returned. If the user has no role at any institute false is returned.

Parameters
string$user_idOptional. The actual user if not set.
array$mvv_rolesOptional. An array of roles. All MvvPlugin-Roles if not set.
Returns
array An array of institute ids or an empty array.
Here is the call graph for this function:

◆ getPerm()

static getPerm (   $object,
  $status = null,
  $user_id = null,
  $institut_id = null,
  $variant = null 
)
staticfinal

Retrieves the permission for the table or object. Returns the (max) perm the given or current user has globally. If the institute is set, checks for the perm in the context of this institute.

Parameters
object | string$objectAn mvv object or its class name.
string$statusConstrain the permission to this status of the object.
string$user_idThe ID of the user. If not set the ID of the current user.
string | array$institut_idThe ID(s) of institute(s) if the user role is defined for institutes.
string$variantThe optional variant of the object table (e.g. to support different languages)
Returns
int The perm defined in class MVVPlugin.
Exceptions
InvalidArgumentExceptionIf the object is not of type ApplicationSimpleOrMap.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRoles()

static getRoles (   $user_id)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ haveDfEntryPerm()

haveDfEntryPerm (   $df_entry,
  $perm 
)
Here is the call graph for this function:

◆ haveFieldPerm()

haveFieldPerm (   $field,
  $perm = null,
  $user_id = null,
  $institut_id = null 
)
final
Here is the call graph for this function:
Here is the caller graph for this function:

◆ haveObjectPerm()

haveObjectPerm (   $perm,
  $user_id = null 
)
Here is the call graph for this function:

◆ havePerm()

havePerm (   $perm,
  $status = null,
  $user_id = null,
  $institut_id = null 
)
final
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshPrivileges()

static refreshPrivileges (   $mvv_table)
static

◆ setVariant()

setVariant (   $variant)

Field Documentation

◆ PERM_ADMIN

const PERM_ADMIN = 15

Permission to read, write/create and delete the value of the designated field. Possibly the admin have permission to particular functions.

◆ PERM_CREATE

const PERM_CREATE = 7

Permission to read, write/create and delete the value of the designated field.

◆ PERM_READ

const PERM_READ = 1

Permission to read the value of the designated field.

◆ PERM_WRITE

const PERM_WRITE = 3

Permission to read and write the value of the designated field.


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