ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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.

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

64  : Environment
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)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
+ 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  }

◆ getPreconditions()

ilAccessRolePermissionSetObjective::getPreconditions ( Environment  $environment)

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

57  : array
58  {
59  return [
61  ];
62  }

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

◆ $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: