ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ilObjStaticUrlServiceAccess Class Reference
+ Inheritance diagram for ilObjStaticUrlServiceAccess:
+ Collaboration diagram for ilObjStaticUrlServiceAccess:

Public Member Functions

 __construct ()
 
 checkAccessAndThrowException (string $permission)
 
 hasUserPermissionTo (string $permission)
 
 getGlobalRoles ()
 
- 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)
 

Private Member Functions

 resolveUsersGlobalRoles ()
 

Private Attributes

ilObjUser $user
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
int $ref_id
 
array $global_roles = null
 

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

Constructor & Destructor Documentation

◆ __construct()

ilObjStaticUrlServiceAccess::__construct ( )

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

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

References $DIC, and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkAccessAndThrowException()

ilObjStaticUrlServiceAccess::checkAccessAndThrowException ( string  $permission)

Definition at line 43 of file class.ilObjStaticUrlServiceAccess.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:

◆ getGlobalRoles()

ilObjStaticUrlServiceAccess::getGlobalRoles ( )

Definition at line 58 of file class.ilObjStaticUrlServiceAccess.php.

58 : array
59 {
60 $global_roles = $this->rbacreview->getRolesForIDs(
61 $this->rbacreview->getGlobalRoles(),
62 false
63 );
64
65 $roles = [];
66 foreach ($global_roles as $global_role) {
67 $roles[$global_role['rol_id']] = $global_role['title'];
68 }
69
70 return $roles;
71 }

References $global_roles.

◆ hasUserPermissionTo()

ilObjStaticUrlServiceAccess::hasUserPermissionTo ( string  $permission)

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

50 : bool
51 {
52 if ($this->ref_id === null) {
53 return false;
54 }
55 return $this->rbacsystem->checkAccess($permission, $this->ref_id);
56 }

Referenced by checkAccessAndThrowException().

+ Here is the caller graph for this function:

◆ resolveUsersGlobalRoles()

ilObjStaticUrlServiceAccess::resolveUsersGlobalRoles ( )
private

Definition at line 73 of file class.ilObjStaticUrlServiceAccess.php.

73 : array
74 {
75 return $this->global_roles
76 ?? $this->global_roles = $this->rbacreview->assignedGlobalRoles($this->user->getId());
77 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $global_roles

array ilObjStaticUrlServiceAccess::$global_roles = null
private

Definition at line 30 of file class.ilObjStaticUrlServiceAccess.php.

Referenced by getGlobalRoles().

◆ $rbacreview

ilRbacReview ilObjStaticUrlServiceAccess::$rbacreview
private

Definition at line 28 of file class.ilObjStaticUrlServiceAccess.php.

◆ $rbacsystem

ilRbacSystem ilObjStaticUrlServiceAccess::$rbacsystem
private

Definition at line 27 of file class.ilObjStaticUrlServiceAccess.php.

◆ $ref_id

int ilObjStaticUrlServiceAccess::$ref_id
private

Definition at line 29 of file class.ilObjStaticUrlServiceAccess.php.

◆ $user

ilObjUser ilObjStaticUrlServiceAccess::$user
private

Definition at line 26 of file class.ilObjStaticUrlServiceAccess.php.


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