ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective Class Reference
+ Inheritance diagram for ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective:
+ Collaboration diagram for ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective:

Public Member Functions

 __construct (string $type, string $src_ops, string $dest_ops)
 
 getHash ()
 
 getLabel ()
 
 achieve (Environment $environment)
 
 isApplicable (Environment $environment)
 
- Public Member Functions inherited from ilAccessRBACOperationClonedObjective
 __construct (string $type, int $src_id, int $dest_id)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 
 isApplicable (Environment $environment)
 

Protected Member Functions

 getSettingsKeyword ()
 

Protected Attributes

string $src_ops
 
string $dest_ops
 
- Protected Attributes inherited from ilAccessRBACOperationClonedObjective
string $type
 
int $src_id
 
int $dest_id
 

Detailed Description

Definition at line 26 of file AccessRBACOperationClonedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ achieve()

ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::achieve ( Environment  $environment)

Reimplemented from ilAccessRBACOperationClonedObjective.

Definition at line 48 of file AccessRBACOperationClonedObjective.php.

49 {
51 $this->src_id = \ilRbacReview::_getCustomRBACOperationId($this->src_ops, $db);
52 $this->dest_id = \ilRbacReview::_getCustomRBACOperationId($this->dest_ops, $db);
53 ;
54 $env = parent::achieve($environment);
55 $db->insert("settings", [
56 "module" => ["text", $this->type],
57 "keyword" => ["text", $this->getSettingsKeyword()],
58 "value" => ["text", "1"]
59 ]);
60
61 return $env;
62 }
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 ILIAS\$db, ilRbacReview\_getCustomRBACOperationId(), ILIAS\Setup\Environment\getResource(), ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective\getSettingsKeyword(), and ILIAS\Setup\Environment\RESOURCE_DATABASE.

+ Here is the call graph for this function:

◆ getHash()

ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::getHash ( )

Reimplemented from ilAccessRBACOperationClonedObjective.

Definition at line 38 of file AccessRBACOperationClonedObjective.php.

38 : string
39 {
40 return hash("sha256", self::class . $this->type . ":" . $this->src_ops . ":" . $this->dest_ops);
41 }

◆ getLabel()

ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::getLabel ( )

Reimplemented from ilAccessRBACOperationClonedObjective.

Definition at line 43 of file AccessRBACOperationClonedObjective.php.

43 : string
44 {
45 return "Clone rbac operation from $this->src_ops to $this->dest_ops";
46 }

◆ getSettingsKeyword()

ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::getSettingsKeyword ( )
protected

Definition at line 64 of file AccessRBACOperationClonedObjective.php.

64 : string
65 {
66 return "copied_perm_" . $this->src_ops . "_" . $this->dest_ops;
67 }

References ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective\$dest_ops.

Referenced by ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective\achieve(), and ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective\isApplicable().

+ Here is the caller graph for this function:

◆ isApplicable()

ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::isApplicable ( Environment  $environment)

Reimplemented from ilAccessRBACOperationClonedObjective.

Definition at line 69 of file AccessRBACOperationClonedObjective.php.

69 : bool
70 {
72
73 $set = $db->queryF(
74 "SELECT value FROM settings " .
75 " WHERE module = %s AND keyword = %s",
76 ["text", "text"],
77 [$this->type, $this->getSettingsKeyword()]
78 );
79 if ($rec = $db->fetchAssoc($set)) {
80 if ($rec["value"] === "1") {
81 return false;
82 }
83 }
84 return true;
85 }

References ILIAS\$db, ILIAS\Setup\Environment\getResource(), ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective\getSettingsKeyword(), and ILIAS\Setup\Environment\RESOURCE_DATABASE.

+ Here is the call graph for this function:

Field Documentation

◆ $dest_ops

string ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::$dest_ops
protected

◆ $src_ops

string ILIAS\BookingManager\Setup\AccessRBACOperationClonedObjective::$src_ops
protected

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