ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjMainMenuAccess Class Reference

Class ilObjMainMenuAccess. More...

+ Inheritance diagram for ilObjMainMenuAccess:
+ Collaboration diagram for ilObjMainMenuAccess:

Public Member Functions

 __construct ()
 ilObjMainMenuAccess 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()

ilObjMainMenuAccess::__construct ( )

ilObjMainMenuAccess constructor.

Definition at line 24 of file class.ilObjMainMenuAccess.php.

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

25  {
26  global $DIC;
27  $this->rbacsystem = $DIC->rbac()->system();
28  $this->http = $DIC->http();
29  }
global $DIC
Definition: saml.php:7
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Member Function Documentation

◆ checkAccessAndThrowException()

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

Definition at line 37 of file class.ilObjMainMenuAccess.php.

References exit, and hasUserPermissionTo().

38  {
39  if (!$this->hasUserPermissionTo($permission)) {
40  //throw new ilException('Permission denied');
41 
42  echo "KEIN ZUGRIFF!!";
43  exit;
44  }
45  }
exit
Definition: backend.php:16
hasUserPermissionTo(string $permission)
+ Here is the call graph for this function:

◆ hasUserPermissionTo()

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

Definition at line 53 of file class.ilObjMainMenuAccess.php.

References ILIAS\FileDelivery\http().

Referenced by checkAccessAndThrowException().

53  : bool
54  {
55  return (bool) $this->rbacsystem->checkAccess($permission, $this->http->request()->getQueryParams()['ref_id']);
56  }
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

ilObjMainMenuAccess::$http
private

Definition at line 14 of file class.ilObjMainMenuAccess.php.

◆ $rbacsystem

ilObjMainMenuAccess::$rbacsystem
private

Definition at line 18 of file class.ilObjMainMenuAccess.php.


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