◆ __construct()
ilAccessCustomRBACOperationAddedObjective::__construct |
( |
string |
$id, |
|
|
string |
$title, |
|
|
string |
$class, |
|
|
int |
$pos, |
|
|
array |
$types = [] |
|
) |
| |
◆ achieve()
ilAccessCustomRBACOperationAddedObjective::achieve |
( |
Environment |
$environment | ) |
|
Definition at line 67 of file class.ilAccessCustomRBACOperationAddedObjective.php.
References $class, $dic, $id, $pos, $title, ilRbacReview\_getCustomRBACOperationId(), ilObject\_getObjectTypeIdByTitle(), ILIAS\Setup\Environment\getResource(), initEnvironment(), and resetDIC().
69 $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
73 if ($this->
class ==
"create") {
78 if (is_null($ops_id)) {
79 $ops_id = $db->nextId(
"rbac_operations");
82 'ops_id' => [
'integer', $ops_id],
89 $db->insert(
"rbac_operations", $values);
92 foreach ($this->types as $type) {
95 $type_id = $db->nextId(
'object_data');
98 'obj_id' => [
'integer', $type_id],
99 'type' => [
'text',
'typ'],
100 'title' => [
'text', $type],
102 'owner' => [
'integer', -1],
103 'create_date' => [
'timestamp', $db->now()],
104 'last_update' => [
'timestamp', $db->now()]
106 $db->insert(
'object_data', $fields);
110 "SELECT typ_id, ops_id " . PHP_EOL
111 .
"FROM rbac_ta" . PHP_EOL
112 .
"WHERE typ_id = " . $db->quote($type_id,
"integer") . PHP_EOL
113 .
"AND ops_id = " . $db->quote($ops_id,
'integer') . PHP_EOL
116 $result = $db->query($sql);
117 if ($db->numRows($result)) {
122 "typ_id" => [
"integer", $type_id],
123 "ops_id" => [
"integer", $ops_id]
126 $db->insert(
"rbac_ta", $values);
static _getCustomRBACOperationId(string $operation, ?\ilDBInterface $ilDB=null)
initEnvironment(Setup\Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
static _getObjectTypeIdByTitle(string $type, ?\ilDBInterface $ilDB=null)
◆ getHash()
ilAccessCustomRBACOperationAddedObjective::getHash |
( |
| ) |
|
◆ getLabel()
ilAccessCustomRBACOperationAddedObjective::getLabel |
( |
| ) |
|
◆ getPreconditions()
ilAccessCustomRBACOperationAddedObjective::getPreconditions |
( |
Environment |
$environment | ) |
|
◆ initEnvironment()
ilAccessCustomRBACOperationAddedObjective::initEnvironment |
( |
Setup\Environment |
$environment | ) |
|
|
protected |
◆ isApplicable()
ilAccessCustomRBACOperationAddedObjective::isApplicable |
( |
Environment |
$environment | ) |
|
Definition at line 133 of file class.ilAccessCustomRBACOperationAddedObjective.php.
References $dic, ilRbacReview\_getCustomRBACOperationId(), ilObject\_getObjectTypeIdByTitle(), ILIAS\Setup\Environment\getResource(), initEnvironment(), and resetDIC().
135 $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
144 foreach ($this->types as $key => $type) {
146 if (is_null($type_id)) {
151 "SELECT typ_id, ops_id " . PHP_EOL
152 .
"FROM rbac_ta" . PHP_EOL
153 .
"WHERE typ_id = " . $db->quote($type_id,
"integer") . PHP_EOL
154 .
"AND ops_id = " . $db->quote($ops_id,
'integer') . PHP_EOL
157 $result = $db->query($sql);
158 if ($db->numRows($result)) {
159 unset($this->types[$key]);
164 return count($this->types) && in_array($this->
class, [
'create',
'object',
'general']);
static _getCustomRBACOperationId(string $operation, ?\ilDBInterface $ilDB=null)
initEnvironment(Setup\Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
static _getObjectTypeIdByTitle(string $type, ?\ilDBInterface $ilDB=null)
◆ isNotable()
ilAccessCustomRBACOperationAddedObjective::isNotable |
( |
| ) |
|
◆ resetDIC()
ilAccessCustomRBACOperationAddedObjective::resetDIC |
( |
|
$dic | ) |
|
|
protected |
◆ $class
string ilAccessCustomRBACOperationAddedObjective::$class |
|
protected |
◆ $id
string ilAccessCustomRBACOperationAddedObjective::$id |
|
protected |
◆ $pos
int ilAccessCustomRBACOperationAddedObjective::$pos |
|
protected |
◆ $title
string ilAccessCustomRBACOperationAddedObjective::$title |
|
protected |
◆ $types
array ilAccessCustomRBACOperationAddedObjective::$types |
|
protected |
◆ NO_DIC_FOUND
const ilAccessCustomRBACOperationAddedObjective::NO_DIC_FOUND = 'There is no $DIC.' |
|
private |
The documentation for this class was generated from the following file: