ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.StyleAccessManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
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: shib_login.php:26