ILIAS  release_8 Revision v8.24
class.StyleAccessManager.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
23use ilRbacSystem;
24
30{
31 protected bool $enable_write = false;
32 protected int $ref_id = 0;
33 protected int $user_id = 0;
35
36 public function __construct(ilRbacSystem $rbacsystem = null, int $ref_id = 0, int $user_id = 0)
37 {
38 global $DIC;
39
40 $this->rbacsystem = (!is_null($rbacsystem))
42 : $DIC->rbac()->system();
43 $this->ref_id = $ref_id;
44 $this->user_id = $user_id;
45 }
46
47 public function enableWrite(bool $write): void
48 {
49 $this->enable_write = $write;
50 }
51
52 public function checkWrite(): bool
53 {
55 if ($this->ref_id == 0) {
56 return true;
57 }
58
59 return ($this->enable_write ||
61 $this->user_id,
62 "write",
63 $this->ref_id
64 ) ||
66 $this->user_id,
67 "sty_write_content",
68 $this->ref_id
69 )
70 );
71 }
72}
Manages access to content style editing.
__construct(ilRbacSystem $rbacsystem=null, int $ref_id=0, int $user_id=0)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...