ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Setup\AccessRBACOperationClonedObjective Class Reference
+ Inheritance diagram for ILIAS\Setup\AccessRBACOperationClonedObjective:
+ Collaboration diagram for ILIAS\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()

ILIAS\Setup\AccessRBACOperationClonedObjective::__construct ( string  $type,
string  $src_ops,
string  $dest_ops 
)

Member Function Documentation

◆ achieve()

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

Definition at line 48 of file AccessRBACOperationClonedObjective.php.

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

48  : Environment
49  {
50  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
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)
+ Here is the call graph for this function:

◆ getHash()

ILIAS\Setup\AccessRBACOperationClonedObjective::getHash ( )

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\Setup\AccessRBACOperationClonedObjective::getLabel ( )

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\Setup\AccessRBACOperationClonedObjective::getSettingsKeyword ( )
protected

Definition at line 64 of file AccessRBACOperationClonedObjective.php.

References ILIAS\Setup\AccessRBACOperationClonedObjective\$dest_ops.

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

64  : string
65  {
66  return "copied_perm_" . $this->src_ops . "_" . $this->dest_ops;
67  }
+ Here is the caller graph for this function:

◆ isApplicable()

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

Definition at line 69 of file AccessRBACOperationClonedObjective.php.

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

69  : bool
70  {
71  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
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  }
+ Here is the call graph for this function:

Field Documentation

◆ $dest_ops

string ILIAS\Setup\AccessRBACOperationClonedObjective::$dest_ops
protected

◆ $src_ops

string ILIAS\Setup\AccessRBACOperationClonedObjective::$src_ops
protected

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