3 declare(strict_types=1);
    36     public function __construct(
string $id, 
string $title, 
string $class, 
int $pos, array $types = [])
    40         $this->
class = $class;
    47         return hash(
"sha256", self::class . 
"::" . $this->
id);
    52         $types = implode(
",", $this->types);
    53         return "Add custom rbac operation (id=$this->id;title=$this->title;class=$this->class;pos=$this->pos;types=($types))";
    70         $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
    74         if ($this->
class == 
"create") {
    79         if (is_null($ops_id)) {
    80             $ops_id = $db->nextId(
"rbac_operations");
    83                 'ops_id' => [
'integer', $ops_id],
    90             $db->insert(
"rbac_operations", $values);
    93         foreach ($this->types as $type) {
    96                 $type_id = $db->nextId(
'object_data');
    99                     'obj_id' => [
'integer', $type_id],
   100                     'type' => [
'text', 
'typ'],
   101                     'title' => [
'text', $type],
   103                     'owner' => [
'integer', -1],
   104                     'create_date' => [
'timestamp', $db->now()],
   105                     'last_update' => [
'timestamp', $db->now()]
   107                 $db->insert(
'object_data', $fields);
   111                 "SELECT typ_id, ops_id " . PHP_EOL
   112                 . 
"FROM rbac_ta" . PHP_EOL
   113                 . 
"WHERE typ_id = " . $db->quote($type_id, 
"integer") . PHP_EOL
   114                 . 
"AND ops_id = " . $db->quote($ops_id, 
'integer') . PHP_EOL
   117             $result = $db->query($sql);
   118             if ($db->numRows($result)) {
   123                 "typ_id" => [
"integer", $type_id],
   124                 "ops_id" => [
"integer", $ops_id]
   127             $db->insert(
"rbac_ta", $values);
   136         $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
   145         foreach ($this->types as $key => $type) {
   147             if (is_null($type_id)) {
   152                 "SELECT typ_id, ops_id " . PHP_EOL
   153                 . 
"FROM rbac_ta" . PHP_EOL
   154                 . 
"WHERE typ_id = " . $db->quote($type_id, 
"integer") . PHP_EOL
   155                 . 
"AND ops_id = " . $db->quote($ops_id, 
'integer') . PHP_EOL
   158             $result = $db->query($sql);
   159             if ($db->numRows($result)) {
   160                 unset($this->types[$key]);
   165         return count($this->types) && in_array($this->
class, [
'create', 
'object', 
'general']);
   170         $db = $environment->getResource(
Setup\Environment::RESOURCE_DATABASE);
   176         $DIC = self::NO_DIC_FOUND;
   177         if (array_key_exists(
'DIC', 
$GLOBALS)) {
   180         $GLOBALS[
'DIC'] = 
new DI\Container();
   183         if (!defined(
'ILIAS_ABSOLUTE_PATH')) {
   184             define(
'ILIAS_ABSOLUTE_PATH', dirname(__FILE__, 6));
   192         if (
$dic !== self::NO_DIC_FOUND) {
 
initEnvironment(Setup\Environment $environment)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
achieve(Environment $environment)
 
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g. 
 
static _getCustomRBACOperationId(string $operation, \ilDBInterface $ilDB=null)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getPreconditions(Environment $environment)
 
An environment holds resources to be used in the setup process. 
 
__construct(string $id, string $title, string $class, int $pos, array $types=[])
 
isApplicable(Environment $environment)
 
static _getObjectTypeIdByTitle(string $type, \ilDBInterface $ilDB=null)