ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilStudyProgrammePositionBasedAccess.php
Go to the documentation of this file.
1 <?php declare(strict_types = 1);
2 
4 {
6  {
7  $this->pah = $pah;
8  }
9 
10  public function getUsersInPrgAccessibleForOperation(ilObjStudyProgramme $prg, string $operation) : array
11  {
12  return array_map(
13  function ($val) {
14  return (int) $val;
15  },
16  $this->pah->filterUserIdsByPositionOfCurrentUser($operation, $prg->getRefId(), $prg->getMembers())
17  );
18  }
19 
20  public function filterUsersAccessibleForOperation(ilObjStudyProgramme $prg, string $operation, array $user_ids) : array
21  {
22  return array_map(
23  function ($val) {
24  return (int) $val;
25  },
26  $this->pah->filterUserIdsByPositionOfCurrentUser($operation, $prg->getRefId(), $user_ids)
27  );
28  }
29 
30 
31 
32  public function isUserAccessibleForOperationAtPrg(int $usr_id, ilObjStudyProgramme $prg, string $operation) : bool
33  {
34  return count($this->pah->filterUserIdsByPositionOfCurrentUser($operation, $prg->getRefId(), [$usr_id])) > 0;
35  }
36 
37  public function checkPositionAccess($pos_perm, int $ref_id) : bool
38  {
39  return $this->pah->checkPositionAccess($pos_perm, $ref_id);
40  }
41 }
filterUsersAccessibleForOperation(ilObjStudyProgramme $prg, string $operation, array $user_ids)
getUsersInPrgAccessibleForOperation(ilObjStudyProgramme $prg, string $operation)
Interface ilOrgUnitPositionAccessHandler.
isUserAccessibleForOperationAtPrg(int $usr_id, ilObjStudyProgramme $prg, string $operation)
getRefId()
get reference id public