ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjAdministrativeNotificationAccess.php
Go to the documentation of this file.
1 <?php
2 
8 {
9 
13  private $http;
17  private $rbacsystem;
18 
22  public function __construct()
23  {
24  global $DIC;
25  $this->rbacsystem = $DIC->rbac()->system();
26  $this->http = $DIC->http();
27  }
28 
33  public function checkAccessAndThrowException(string $permission) : void
34  {
35  if (!$this->hasUserPermissionTo($permission)) {
36  throw new ilException('Permission denied');
37  }
38  }
39 
44  public function hasUserPermissionTo(string $permission) : bool
45  {
46  return (bool) $this->rbacsystem->checkAccess($permission, $this->http->request()->getQueryParams()['ref_id']);
47  }
48 }
static http()
Fetches the global http state from ILIAS.
__construct()
ilObjAdministrativeNotificationAccess constructor.
global $DIC
Definition: goto.php:24