ILIAS  release_8 Revision v8.24
class.ilDataCollectionAccessAdapter.php
Go to the documentation of this file.
1<?php
2
20{
22
23 private function __construct(ilAccess $ilAccess)
24 {
25 $this->ilAccess = $ilAccess;
26 }
27
28 public static function new(): self
29 {
30 global $DIC;
31 return new self($DIC->access());
32 }
33
34 public function hasVisiblePermission(int $refId): bool
35 {
36 return $this->ilAccess->checkAccess('visible', "", $refId);
37 }
38
39 public function hasReadPermission(int $refId): bool
40 {
41 return $this->ilAccess->checkAccess('read', "", $refId);
42 }
43
44 public function hasWritePermission(int $refId): bool
45 {
46 return $this->ilAccess->checkAccess('write', "", $refId);
47 }
48
49 public function hasEditPermissionPermission(int $refId): bool
50 {
51 return $this->ilAccess->checkAccess('edit_permission', "", $refId);
52 }
53
54 public function hasVisibleOrReadPermission(int $refId): bool
55 {
56 return ($this->hasVisiblePermission($refId) || $this->hasReadPermission($refId));
57 }
58}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$refId
Definition: xapitoken.php:58