26 private \ilOrgUnitUserAssignmentQueries
$ua;
27 private \ilOrgUnitGlobalSettings
$set;
37 $this->
user = $DIC->user();
58 $assignment_of_user = $this->ua->getAssignmentsOfUserId($for_user_id);
59 $other_users_in_same_org_units = [];
60 foreach ($assignment_of_user as $assignment) {
61 $other_users_in_same_org_units += $this->ua->getUserIdsOfOrgUnit($assignment->getOrguId());
64 return array_intersect($user_ids, $other_users_in_same_org_units);
88 return ($on_user_ids === array_intersect($on_user_ids, $filtered_user_ids)
89 && $filtered_user_ids === array_intersect($filtered_user_ids, $on_user_ids));
115 $allowed_user_ids = [];
116 foreach ($this->ua->getPositionsOfUserId($user_id) as $position) {
117 $permissions = ilOrgUnitPermissionQueries::getSetForRefId($ref_id, $position->getId());
118 $permissions->afterObjectLoad();
119 if (!$permissions->isOperationIdSelected($operation->getOperationId())) {
123 $position->afterObjectLoad();
124 foreach ($position->getAuthorities() as $authority) {
125 switch ($authority->getOver()) {
127 switch ($authority->getScope()) {
129 $allowed = $this->ua->getUserIdsOfOrgUnitsOfUsersPosition($position->getId(), $user_id);
130 $allowed_user_ids = array_merge($allowed_user_ids, $allowed);
133 $allowed = $this->ua->getUserIdsOfOrgUnitsOfUsersPosition(
138 $allowed_user_ids = array_merge($allowed_user_ids, $allowed);
143 switch ($authority->getScope()) {
145 $allowed = $this->ua->getUserIdsOfUsersOrgUnitsInPosition(
147 $authority->getPositionId(),
148 $authority->getOver(),
151 $allowed_user_ids = array_merge($allowed_user_ids, $allowed);
154 $allowed = $this->ua->getUserIdsOfUsersOrgUnitsInPosition(
156 $authority->getPositionId(),
157 $authority->getOver(),
160 $allowed_user_ids = array_merge($allowed_user_ids, $allowed);
167 $allowed_user_ids[] = $this->
user->getId();
168 return array_intersect($user_ids, $allowed_user_ids);
184 foreach ($this->ua->getPositionsOfUserId($current_user_id) as $position) {
185 $permissions = ilOrgUnitPermissionQueries::getSetForRefId($ref_id, $position->getId());
186 if ($permissions->isOperationIdSelected($operation->getOperationId())) {
203 foreach ($this->ua->getPositionsOfUserId($current_user_id) as $position) {
204 $permissions = ilOrgUnitPermissionQueries::getSetForRefId($ref_id, $position->getId());
205 if (count($permissions->getOperations()) > 0) {
217 if ($this->
access->checkAccess($rbac_perm,
'', $ref_id)) {
238 if ($this->
access->checkAccess($rbac_perm,
'', $ref_id)) {
248 if ($this->
access->checkAccess($rbac_perm,
'', $ref_id)) {
262 return $this->
user->getId();
268 if (!isset(self::$ref_id_obj_type_map[$ref_id])) {
272 return self::$ref_id_obj_type_map[
$ref_id];
284 return $this->
set->isPositionAccessActiveForObject($obj_id);
__construct(ilAccess $access)
static findByOperationString(string $operation_string, string $context_name)
isUserBasedOnPositionsAllowedTo(int $which_user_id, string $permission, array $on_user_ids)
ilOrgUnitUserAssignmentQueries $ua
hasUserRBACorAnyPositionAccess(string $rbac_perm, int $ref_id)
checkPositionAccess(string $pos_perm, int $ref_id)
filterUserIdsByPositionOfCurrentUser(string $pos_perm, int $ref_id, array $user_ids)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTypeForRefId(int $ref_id)
Interface ilOrgUnitPositionAndRBACAccessHandler Provides access checks due to a users OrgUnit-Positio...
isPositionActiveForRefId(int $ref_id)
static _lookupObjectId(int $ref_id)
hasCurrentUserAnyPositionAccess(int $ref_id)
filterUserIdsByPositionOfUser(int $user_id, string $pos_perm, int $ref_id, array $user_ids)
static array $ref_id_obj_type_map
checkRbacOrPositionPermissionAccess(string $rbac_perm, string $pos_perm, int $ref_id)
Interface ilOrgUnitPositionAccessHandler Provides access checks due to a users OrgUnit-Positions.
filterUserIdsForCurrentUsersPositionsAndPermission(array $user_ids, string $permission)
filterUserIdsByRbacOrPositionOfCurrentUser(string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids)
filterUserIdsForUsersPositionsAndPermission(array $user_ids, int $for_user_id, string $permission)
isCurrentUserBasedOnPositionsAllowedTo(string $permission, array $on_user_ids)
static _lookupType(int $id, bool $reference=false)
ilOrgUnitGlobalSettings $set
const SCOPE_SUBSEQUENT_ORGUS
getObjIdForRefId(int $ref_id)