19 declare(strict_types=1);
31 public function __construct(
string $type,
string $id,
string $description, array $op_ids = [])
41 return hash(
"sha256", self::class);
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)";
64 $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
66 $tpl_id = $db->nextId(
"object_data");
68 "obj_id" => [
"integer", $tpl_id],
69 "type" => [
"text",
"rolt"],
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")]
76 $db->insert(
"object_data", $values);
79 "rol_id" => [
"integer", $tpl_id],
80 "parent" => [
"integer", 8],
81 "assign" => [
"text",
"n"],
82 "protected" => [
"text",
"n"]
84 $db->insert(
"rbac_fa", $values);
86 foreach ($this->op_ids as $op_id) {
88 "rol_id" => [
"integer", $tpl_id],
90 "ops_id" => [
"integer", $op_id],
91 "parent" => [
"integer", 8]
93 $db->insert(
"rbac_templates", $values);
101 return (
bool) count($this->op_ids);
__construct(string $type, string $id, string $description, array $op_ids=[])
isApplicable(Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
achieve(Environment $environment)
getPreconditions(Environment $environment)