19 declare(strict_types=1);
31 $this->database = $db;
37 "SELECT ops_id FROM rbac_operations WHERE operation = %s",
50 $edit_file_ops_id = $this->
getOpsID($this->database, self::EDIT_FILE);
57 JOIN object_reference ON rbac_pa.ref_id = object_reference.ref_id 58 JOIN object_data ON object_reference.obj_id = object_data.obj_id 59 WHERE object_data.type = 'file'; 62 $res = $this->database->query(
$q);
63 while ($row = $this->database->fetchAssoc(
$res)) {
64 $ops_ids = unserialize($row[
'ops_id'], [
'allowed_classes' =>
false]);
65 if (in_array(4, $ops_ids,
false) && !in_array($edit_file_ops_id, $ops_ids,
false)) {
66 $ops_ids[] = $edit_file_ops_id;
67 $ops_ids = array_unique($ops_ids);
68 $new_ops_ids = serialize($ops_ids);
69 $this->database->update(
72 'ops_id' => [
'text', $new_ops_ids]
75 'rol_id' => [
'integer', $row[
'rol_id']],
76 'ref_id' => [
'integer', $row[
'ref_id']]
88 $edit_file_ops_id = $this->
getOpsID($this->database, self::EDIT_FILE);
90 $q =
"SELECT * from rbac_templates WHERE type = %s AND ops_id = %s";
91 $res = $this->database->queryF(
96 while ($row = $this->database->fetchAssoc(
$res)) {
98 $this->database->insert(
101 'type' => [
'text',
'file'],
102 'ops_id' => [
'integer', $edit_file_ops_id],
103 'rol_id' => [
'integer', $row[
'rol_id']],
104 'parent' => [
'integer', $row[
'parent']]
getOpsID(ilDBInterface $db, string $operation)
fetchAssoc(ilDBStatement $statement)
step_2()
add to all templates which already have the "edit" operation assigned fo files
step_1()
assign to all roles which already have the "edit" operation assigned fo files
prepare(ilDBInterface $db)
queryF(string $query, array $types, array $values)