ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\Wiki\Setup\AccessRBACOperationClonedObjective Class Reference
+ Inheritance diagram for ILIAS\Wiki\Setup\AccessRBACOperationClonedObjective:
+ Collaboration diagram for ILIAS\Wiki\Setup\AccessRBACOperationClonedObjective:

Public Member Functions

 __construct (string $type, string $src_ops, string $dest_ops)
 
 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 class.AccessRBACOperationClonedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ achieve()

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

Definition at line 43 of file class.AccessRBACOperationClonedObjective.php.

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

43  : Environment
44  {
45  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
46  $this->src_id = \ilRbacReview::_getCustomRBACOperationId($this->src_ops, $db);
47  $this->dest_id = \ilRbacReview::_getCustomRBACOperationId($this->dest_ops, $db);
48  ;
49  $env = parent::achieve($environment);
50  $db->insert("settings", [
51  "module" => ["text", $this->type],
52  "keyword" => ["text", $this->getSettingsKeyword()],
53  "value" => ["text", "1"]
54  ]);
55 
56  return $env;
57  }
static _getCustomRBACOperationId(string $operation, ?\ilDBInterface $ilDB=null)
+ Here is the call graph for this function:

◆ getLabel()

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

Definition at line 38 of file class.AccessRBACOperationClonedObjective.php.

38  : string
39  {
40  return "Clone rbac operation from $this->src_ops to $this->dest_ops";
41  }

◆ getSettingsKeyword()

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

◆ isApplicable()

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

Definition at line 64 of file class.AccessRBACOperationClonedObjective.php.

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

64  : bool
65  {
66  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
67 
68  $set = $db->queryF(
69  "SELECT value FROM settings " .
70  " WHERE module = %s AND keyword = %s",
71  ["text", "text"],
72  [$this->type, $this->getSettingsKeyword()]
73  );
74  if ($rec = $db->fetchAssoc($set)) {
75  if ($rec["value"] === "1") {
76  return false;
77  }
78  }
79 
80  return true;
81  }
+ Here is the call graph for this function:

Field Documentation

◆ $dest_ops

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

◆ $src_ops

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

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