19 declare(strict_types=1);
32 $res = $this->db->queryF(
33 "SELECT obj_id FROM object_data WHERE type = %s AND title = %s",
35 [
'rolt',
'il_frm_moderator']
38 $row = $this->db->fetchAssoc(
$res);
39 if (!isset($row[
'obj_id'])) {
43 $rol_id = (
int) $row[
'obj_id'];
45 $res = $this->db->query(
46 "SELECT ops_id FROM rbac_operations WHERE " . $this->db->in(
48 [
'edit_permission',
'delete',
'copy'],
54 $rows = $this->db->fetchAll(
$res);
59 $operations_to_remove = [];
60 foreach ($rows as $row) {
61 $operations_to_remove[] = (
int) $row[
'ops_id'];
64 foreach ($operations_to_remove as $op_id) {
65 $this->db->manipulateF(
66 "DELETE FROM rbac_templates WHERE rol_id = %s AND type = %s AND ops_id = %s AND parent = %s",
68 [$rol_id,
'frm', $op_id, 8]
72 $this->db->manipulateF(
73 "INSERT INTO settings (module, keyword, value) VALUES (%s, %s, %s)",
75 [
'forum',
'frm_mod_tpl_perm_revocation',
'1']
prepare(ilDBInterface $db)