ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 24 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 64 of file class.ilAccessRolePermissionSetObjective.php.

65 {
66 $db = $environment->getResource(Environment::RESOURCE_DATABASE);
67
68 foreach ($this->ops as $ops_id) {
69 if ($ops_id == self::RBAC_OP_COPY) {
71 }
72
73 $db->replace(
74 'rbac_templates',
75 [
76 'rol_id' => ['integer', $this->role_id],
77 'type' => ['text', $this->type],
78 'ops_id' => ['integer', $ops_id],
79 'parent' => ['integer', $this->ref_id]
80 ],
81 []
82 );
83 }
84
85 return $environment;
86 }
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 41 of file class.ilAccessRolePermissionSetObjective.php.

41 : string
42 {
43 return hash("sha256", self::class);
44 }

◆ getLabel()

ilAccessRolePermissionSetObjective::getLabel ( )

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

46 : string
47 {
48 $ops = implode(",", $this->ops);
49 return "Set role permission (role id=$this->role_id;type=$this->type;ops=$ops;ref id=$this->ref_id)";
50 }

References $ops.

◆ getPreconditions()

ilAccessRolePermissionSetObjective::getPreconditions ( Environment  $environment)

◆ isApplicable()

ilAccessRolePermissionSetObjective::isApplicable ( Environment  $environment)

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

88 : bool
89 {
90 return true;
91 }

◆ isNotable()

ilAccessRolePermissionSetObjective::isNotable ( )

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

52 : bool
53 {
54 return true;
55 }

Field Documentation

◆ $ops

array ilAccessRolePermissionSetObjective::$ops
protected

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

Referenced by __construct(), and getLabel().

◆ $ref_id

int ilAccessRolePermissionSetObjective::$ref_id
protected

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

Referenced by __construct().

◆ $role_id

int ilAccessRolePermissionSetObjective::$role_id
protected

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

Referenced by __construct().

◆ $type

string ilAccessRolePermissionSetObjective::$type
protected

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

Referenced by __construct().

◆ RBAC_OP_COPY

const ilAccessRolePermissionSetObjective::RBAC_OP_COPY = 99
protected

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


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