ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjWebDAVAccess.php
Go to the documentation of this file.
1<?php
2
8{
12 private $http;
16 private $rbacsystem;
17
21 public function __construct()
22 {
23 global $DIC;
24 $this->rbacsystem = $DIC->rbac()->system();
25 $this->http = $DIC->http();
26 }
27
32 public function checkAccessAndThrowException(string $permission) : void
33 {
34 if (!$this->hasUserPermissionTo($permission)) {
35 throw new ilException('Permission denied');
36 }
37 }
38
43 public function hasUserPermissionTo(string $permission) : bool
44 {
45 return (bool) $this->rbacsystem->checkAccess($permission, $this->http->request()->getQueryParams()['ref_id']);
46 }
47
48}
An exception for terminatinating execution or to throw for unit testing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjWebDAVAccess.
__construct()
ilObjWebDAVAccess constructor.
checkAccessAndThrowException(string $permission)
hasUserPermissionTo(string $permission)
Class ilObjectAccess.
global $DIC
Definition: goto.php:24
static http()
Fetches the global http state from ILIAS.