ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\User\Setup\AddReadAllAccountsPermissionObjective Class Reference
+ Inheritance diagram for ILIAS\User\Setup\AddReadAllAccountsPermissionObjective:
+ Collaboration diagram for ILIAS\User\Setup\AddReadAllAccountsPermissionObjective:

Public Member Functions

 getHash ()
 Get a hash for this objective. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 
 getHash ()
 Get a hash for this objective. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

Private Attributes

const string TYPE = 'usrf'
 
const int VISIBLE = 2
 
const int READ = 3
 

Detailed Description

Definition at line 29 of file AddReadAllAccountsPermissionObjective.php.

Member Function Documentation

◆ achieve()

ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::achieve ( Environment  $environment)

Objectives can be achieved.

They might add resources to the environment when they have been achieved.

This method needs to be idempotent for a given environment. That means: if this is executed a second time, nothing new should happen. Or the other way round: if the environment already looks like desired, the objective should not take any further actions when this is called.

Exceptions

LogicException if there are unfullfilled preconditions.

Exceptions

RuntimeException if there are missing resources.

Implements ILIAS\Setup\Objective.

Definition at line 57 of file AddReadAllAccountsPermissionObjective.php.

57 : Environment
58 {
60 'read_all_accounts',
61 'read all accounts',
62 'object',
63 2100,
64 [self::TYPE]
65 ))->achieve($environment);
66
67 $new_id = $this->getAddedOperationId($environment);
68 if ($new_id !== null) {
69
71 self::TYPE,
72 self::READ,
73 $new_id
74 ))->achieve($environment);
75
77 self::TYPE,
78 self::VISIBLE,
79 self::READ
80 ))->achieve($environment);
81
82 (new \ilAccessRBACOperationDeletedObjective(
83 self::TYPE,
84 self::VISIBLE
85 ))->achieve($environment);
86 }
87
88 return $environment;
89 }
achieve(Environment $environment)
Objectives can be achieved.

References ILIAS\User\Setup\AddReadAllAccountsPermissionObjective\achieve().

Referenced by ILIAS\User\Setup\AddReadAllAccountsPermissionObjective\achieve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHash()

ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::getHash ( )

Get a hash for this objective.

The hash of two objectives must be the same, if they are the same objective, with the same config on the same environment, i.e. if the one is achieved the other is achieved as well because they are the same.

Implements ILIAS\Setup\Objective.

Definition at line 35 of file AddReadAllAccountsPermissionObjective.php.

35 : string
36 {
37 return hash('sha256', self::class);
38 }

◆ getLabel()

ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::getLabel ( )

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 40 of file AddReadAllAccountsPermissionObjective.php.

40 : string
41 {
42 return ('Add the "Read All Accounts" permission to the user folder');
43 }

◆ getPreconditions()

ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::getPreconditions ( Environment  $environment)

Objectives might depend on other objectives.

Exceptions
UnachievableExceptionif the objective is not achievable
Returns
Objective[]

Implements ILIAS\Setup\Objective.

Definition at line 50 of file AddReadAllAccountsPermissionObjective.php.

◆ isApplicable()

ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::isApplicable ( Environment  $environment)

Get to know whether the objective is applicable.

Don't change the environment or cause changes on services in the environment. Just check if this objective needs to be achieved, either currently or at all. In case of doubt whether the objective is applicable or not return true.

Implements ILIAS\Setup\Objective.

Definition at line 91 of file AddReadAllAccountsPermissionObjective.php.

91 : bool
92 {
93 return $this->getAddedOperationId($environment) === null;
94 }

◆ isNotable()

ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::isNotable ( )

Get to know if this is an interesting objective for a human.

Implements ILIAS\Setup\Objective.

Definition at line 45 of file AddReadAllAccountsPermissionObjective.php.

45 : bool
46 {
47 return true;
48 }

Field Documentation

◆ READ

const int ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::READ = 3
private

Definition at line 33 of file AddReadAllAccountsPermissionObjective.php.

◆ TYPE

const string ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::TYPE = 'usrf'
private

Definition at line 31 of file AddReadAllAccountsPermissionObjective.php.

◆ VISIBLE

const int ILIAS\User\Setup\AddReadAllAccountsPermissionObjective::VISIBLE = 2
private

Definition at line 32 of file AddReadAllAccountsPermissionObjective.php.


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