ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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()

Member Function Documentation

◆ achieve()

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

Reimplemented from ilAccessRBACOperationClonedObjective.

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

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)

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

+ Here is the call graph for this function:

◆ getLabel()

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

Reimplemented from ilAccessRBACOperationClonedObjective.

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

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

59 : string
60 {
61 return "copied_perm_" . $this->src_ops . "_" . $this->dest_ops;
62 }

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

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

+ Here is the caller graph for this function:

◆ isApplicable()

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

Reimplemented from ilAccessRBACOperationClonedObjective.

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

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 }

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

+ 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: