ILIAS  release_8 Revision v8.24
ilAccessRolePermissionSetObjective Class Reference
+ Inheritance diagram for ilAccessRolePermissionSetObjective:
+ Collaboration diagram for ilAccessRolePermissionSetObjective:

Public Member Functions

 __construct (int $role_id, string $type, array $ops, int $ref_id)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 
 isApplicable (Environment $environment)
 

Protected Attributes

const RBAC_OP_COPY = 99
 
int $role_id
 
string $type
 
array $ops
 
int $ref_id
 

Detailed Description

Definition at line 10 of file class.ilAccessRolePermissionSetObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilAccessRolePermissionSetObjective::__construct ( int  $role_id,
string  $type,
array  $ops,
int  $ref_id 
)

Member Function Documentation

◆ achieve()

ilAccessRolePermissionSetObjective::achieve ( Environment  $environment)

Definition at line 50 of file class.ilAccessRolePermissionSetObjective.php.

51 {
52 $db = $environment->getResource(Environment::RESOURCE_DATABASE);
53
54 foreach ($this->ops as $ops_id) {
55 if ($ops_id == self::RBAC_OP_COPY) {
57 }
58
59 $db->replace(
60 'rbac_templates',
61 [
62 'rol_id' => ['integer', $this->role_id],
63 'type' => ['text', $this->type],
64 'ops_id' => ['integer', $ops_id],
65 'parent' => ['integer', $this->ref_id]
66 ],
67 []
68 );
69 }
70
71 return $environment;
72 }
static _getCustomRBACOperationId(string $operation, \ilDBInterface $ilDB=null)
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.

References ilRbacReview\_getCustomRBACOperationId(), and ILIAS\Setup\Environment\getResource().

+ Here is the call graph for this function:

◆ getHash()

ilAccessRolePermissionSetObjective::getHash ( )

Definition at line 27 of file class.ilAccessRolePermissionSetObjective.php.

27 : string
28 {
29 return hash("sha256", self::class);
30 }

◆ getLabel()

ilAccessRolePermissionSetObjective::getLabel ( )

Definition at line 32 of file class.ilAccessRolePermissionSetObjective.php.

32 : string
33 {
34 $ops = implode(",", $this->ops);
35 return "Set role permission (role id=$this->role_id;type=$this->type;ops=$ops;ref id=$this->ref_id)";
36 }

References $ops.

◆ getPreconditions()

ilAccessRolePermissionSetObjective::getPreconditions ( Environment  $environment)

◆ isApplicable()

ilAccessRolePermissionSetObjective::isApplicable ( Environment  $environment)

Definition at line 74 of file class.ilAccessRolePermissionSetObjective.php.

74 : bool
75 {
76 return true;
77 }

◆ isNotable()

ilAccessRolePermissionSetObjective::isNotable ( )

Definition at line 38 of file class.ilAccessRolePermissionSetObjective.php.

38 : bool
39 {
40 return true;
41 }

Field Documentation

◆ $ops

array ilAccessRolePermissionSetObjective::$ops
protected

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

Referenced by __construct(), and getLabel().

◆ $ref_id

int ilAccessRolePermissionSetObjective::$ref_id
protected

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

Referenced by __construct().

◆ $role_id

int ilAccessRolePermissionSetObjective::$role_id
protected

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

Referenced by __construct().

◆ $type

string ilAccessRolePermissionSetObjective::$type
protected

Definition at line 15 of file class.ilAccessRolePermissionSetObjective.php.

Referenced by __construct().

◆ RBAC_OP_COPY

const ilAccessRolePermissionSetObjective::RBAC_OP_COPY = 99
protected

Definition at line 12 of file class.ilAccessRolePermissionSetObjective.php.


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