ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
PermissionManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
27{
28 public function __construct(
29 protected InternalDomainService $domain
30 ) {
31 }
32
34 string $perm,
35 int $obj_id,
36 int $user_id
37 ): int {
38 $access = $this->domain->access();
39
40 foreach (\ilObject::_getAllReferences($obj_id) as $ref_id) {
41 if ($access->checkAccessOfUser($user_id, $perm, "", $ref_id)) {
42 return $ref_id;
43 }
44 }
45 return 0;
46 }
47
48}
getFirstRefIdWithPermission(string $perm, int $obj_id, int $user_id)
__construct(protected InternalDomainService $domain)
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:66