ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAccessRBACTemplateAddedObjective Class Reference
+ Inheritance diagram for ilAccessRBACTemplateAddedObjective:
+ Collaboration diagram for ilAccessRBACTemplateAddedObjective:

Public Member Functions

 __construct (string $type, string $id, string $description, array $op_ids=[])
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 
 isApplicable (Environment $environment)
 

Protected Attributes

string $type
 
string $id
 
string $description
 
array $op_ids
 

Detailed Description

Definition at line 24 of file class.ilAccessRBACTemplateAddedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilAccessRBACTemplateAddedObjective::__construct ( string  $type,
string  $id,
string  $description,
array  $op_ids = [] 
)

Member Function Documentation

◆ achieve()

ilAccessRBACTemplateAddedObjective::achieve ( Environment  $environment)

Definition at line 62 of file class.ilAccessRBACTemplateAddedObjective.php.

63 {
64 $db = $environment->getResource(Environment::RESOURCE_DATABASE);
65
66 $tpl_id = $db->nextId("object_data");
67 $values = [
68 "obj_id" => ["integer", $tpl_id],
69 "type" => ["text", "rolt"],
70 "title" => ["text", $this->id],
71 "description" => ["text", $this->description],
72 "owner" => ["integer", -1],
73 "create_date" => ["timestamp", date("Y-m-d H:i:s")],
74 "last_update" => ["timestamp", date("Y-m-d H:i:s")]
75 ];
76 $db->insert("object_data", $values);
77
78 $values = [
79 "rol_id" => ["integer", $tpl_id],
80 "parent" => ["integer", 8],
81 "assign" => ["text", "n"],
82 "protected" => ["text", "n"]
83 ];
84 $db->insert("rbac_fa", $values);
85
86 foreach ($this->op_ids as $op_id) {
87 $values = [
88 "rol_id" => ["integer", $tpl_id],
89 "type" => ["text", $this->type],
90 "ops_id" => ["integer", $op_id],
91 "parent" => ["integer", 8]
92 ];
93 $db->insert("rbac_templates", $values);
94 }
95
96 return $environment;
97 }
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 $description, $id, $type, and ILIAS\Setup\Environment\getResource().

+ Here is the call graph for this function:

◆ getHash()

ilAccessRBACTemplateAddedObjective::getHash ( )

Definition at line 39 of file class.ilAccessRBACTemplateAddedObjective.php.

39 : string
40 {
41 return hash("sha256", self::class);
42 }

◆ getLabel()

ilAccessRBACTemplateAddedObjective::getLabel ( )

Definition at line 44 of file class.ilAccessRBACTemplateAddedObjective.php.

44 : string
45 {
46 $op_ids = implode(",", $this->op_ids);
47 return "Add rbac template (type=$this->type;id=$this->id;description=$this->description;op_ids=$op_ids)";
48 }

References $op_ids.

◆ getPreconditions()

ilAccessRBACTemplateAddedObjective::getPreconditions ( Environment  $environment)

◆ isApplicable()

ilAccessRBACTemplateAddedObjective::isApplicable ( Environment  $environment)

Definition at line 99 of file class.ilAccessRBACTemplateAddedObjective.php.

99 : bool
100 {
101 return (bool) count($this->op_ids);
102 }

◆ isNotable()

ilAccessRBACTemplateAddedObjective::isNotable ( )

Definition at line 50 of file class.ilAccessRBACTemplateAddedObjective.php.

50 : bool
51 {
52 return true;
53 }

Field Documentation

◆ $description

string ilAccessRBACTemplateAddedObjective::$description
protected

Definition at line 28 of file class.ilAccessRBACTemplateAddedObjective.php.

Referenced by __construct(), and achieve().

◆ $id

string ilAccessRBACTemplateAddedObjective::$id
protected

Definition at line 27 of file class.ilAccessRBACTemplateAddedObjective.php.

Referenced by __construct(), and achieve().

◆ $op_ids

array ilAccessRBACTemplateAddedObjective::$op_ids
protected

Definition at line 29 of file class.ilAccessRBACTemplateAddedObjective.php.

Referenced by __construct(), and getLabel().

◆ $type

string ilAccessRBACTemplateAddedObjective::$type
protected

Definition at line 26 of file class.ilAccessRBACTemplateAddedObjective.php.

Referenced by __construct(), and achieve().


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