ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilObjAdministrativeNotificationAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjAdministrativeNotificationAccess:
+ Collaboration diagram for ilObjAdministrativeNotificationAccess:

Public Member Functions

 __construct ()
 ilObjAdministrativeNotificationAccess constructor. More...
 
 checkAccessAndThrowException (string $permission)
 
 hasUserPermissionTo (string $permissions_string)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Protected Attributes

int $ref_id
 

Private Attributes

ilRbacSystem $rbacsystem
 

Additional Inherited Members

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

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 22 of file class.ilObjAdministrativeNotificationAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjAdministrativeNotificationAccess::__construct ( )

ilObjAdministrativeNotificationAccess constructor.

Definition at line 31 of file class.ilObjAdministrativeNotificationAccess.php.

32 {
33 global $DIC;
34 $this->rbacsystem = $DIC->rbac()->system();
35 $this->ref_id = $DIC->http()->wrapper()->query()->has('ref_id')
36 ? $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int())
37 : null;
38 }
global $DIC
Definition: shib_login.php:26

References $DIC.

Member Function Documentation

◆ checkAccessAndThrowException()

ilObjAdministrativeNotificationAccess::checkAccessAndThrowException ( string  $permission)
Exceptions
ilException

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

43 : void
44 {
45 if (!$this->hasUserPermissionTo($permission)) {
46 throw new ilException('Permission denied');
47 }
48 }
Base class for ILIAS Exception handling.

References hasUserPermissionTo().

+ Here is the call graph for this function:

◆ hasUserPermissionTo()

ilObjAdministrativeNotificationAccess::hasUserPermissionTo ( string  $permissions_string)

Definition at line 50 of file class.ilObjAdministrativeNotificationAccess.php.

50 : bool
51 {
52 $permissions = explode(',', $permissions_string);
53 foreach ($permissions as $permission) {
54 if ($this->rbacsystem->checkAccess($permission, $this->ref_id)) {
55 return true;
56 }
57 }
58 return false;
59 }

Referenced by checkAccessAndThrowException().

+ Here is the caller graph for this function:

Field Documentation

◆ $rbacsystem

ilRbacSystem ilObjAdministrativeNotificationAccess::$rbacsystem
private

◆ $ref_id

int ilObjAdministrativeNotificationAccess::$ref_id
protected

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