ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjFileServicesAccess Class Reference

Class ilObjFileServicesAccess. More...

+ Inheritance diagram for ilObjFileServicesAccess:
+ Collaboration diagram for ilObjFileServicesAccess:

Public Member Functions

 __construct ()
 ilObjFileServicesAccess constructor. More...
 
 checkAccessAndThrowException (string $permission)
 
 hasUserPermissionTo (string $permission)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 

Private Attributes

 $http
 
 $rbacsystem
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileServicesAccess::__construct ( )

ilObjFileServicesAccess constructor.

Definition at line 21 of file class.ilObjFileServicesAccess.php.

References $DIC, and ILIAS\FileDelivery\http().

22  {
23  global $DIC;
24  $this->rbacsystem = $DIC->rbac()->system();
25  $this->http = $DIC->http();
26  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ checkAccessAndThrowException()

ilObjFileServicesAccess::checkAccessAndThrowException ( string  $permission)
Parameters
string$permission
Exceptions
ilException

Definition at line 32 of file class.ilObjFileServicesAccess.php.

References hasUserPermissionTo().

32  : void
33  {
34  if (!$this->hasUserPermissionTo($permission)) {
35  throw new ilException('Permission denied');
36  }
37  }
+ Here is the call graph for this function:

◆ hasUserPermissionTo()

ilObjFileServicesAccess::hasUserPermissionTo ( string  $permission)
Parameters
string$permission
Returns
bool

Definition at line 43 of file class.ilObjFileServicesAccess.php.

References ILIAS\FileDelivery\http().

Referenced by checkAccessAndThrowException().

43  : bool
44  {
45  return (bool) $this->rbacsystem->checkAccess($permission, $this->http->request()->getQueryParams()['ref_id']);
46  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $http

ilObjFileServicesAccess::$http
private

Definition at line 12 of file class.ilObjFileServicesAccess.php.

◆ $rbacsystem

ilObjFileServicesAccess::$rbacsystem
private

Definition at line 16 of file class.ilObjFileServicesAccess.php.


The documentation for this class was generated from the following file: