3 declare(strict_types=1);
47 'rp_visible' =>
'visible',
49 'rp_write' =>
'write',
50 'rp_manage_members' =>
'manage_members' 79 public function may(
string $operation): bool
82 if (in_array($operation, self::ORGU_OPERATIONS)) {
84 $this->
access->checkAccess(
85 self::ROLEMAPPINGS[self::ROLEPERM_MANAGE_MEMBERS],
98 public function mayAnyOf(array $operations): bool
100 foreach ($operations as $operation) {
101 if ($this->
may($operation)) {
115 if ($this->
may(self::ROLEPERM_MANAGE_MEMBERS)) {
119 if (in_array($operation, self::ORGU_OPERATIONS) && $this->
may($operation)) {
130 if ($this->
may(self::ROLEPERM_MANAGE_MEMBERS)) {
134 return $this->orgu_access->filterUserIdsByPositionOfCurrentUser(
144 self::ORGU_OPERATIONS,
148 self::ROLEPERM_WRITE,
149 self::ROLEPERM_MANAGE_MEMBERS
153 if (!in_array($operation,
$valid)) {
154 throw new ilException(
'prg does not provide this permission: ' . $operation);
160 if (!isset($this->cache[$orgu_operation])) {
161 $user_ids = array_map(
163 $this->orgu_access->filterUserIdsByPositionOfCurrentUser(
165 $this->getProgrammeRefId(),
169 $this->cache[$orgu_operation] = array_unique($user_ids);
171 return $this->cache[$orgu_operation];
179 if (!isset($this->cache[self::ROLEPERM_MANAGE_MEMBERS])) {
181 $this->cache[self::ROLEPERM_MANAGE_MEMBERS] = array_unique($prg->getMembers());
183 return $this->cache[self::ROLEPERM_MANAGE_MEMBERS];
194 $type_settings = $this->orgu_settings->getObjectPositionSettingsByType(
'prg');
196 return $type_settings->isActive() && $type_settings->isChangeableForObject();
const OP_VIEW_INDIVIDUAL_PLAN
getUserIdsInPrgAccessibleForOperation(string $orgu_operation)
static getInstanceByRefId($ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const OP_EDIT_INDIVIDUAL_PLAN
isOrguAccessEnabledGlobally()
const OP_READ_LEARNING_PROGRESS
__construct(ilAccess $access, ilOrgUnitGlobalSettings $orgu_settings, ilObjectDataCache $data_cache, ilOrgUnitPositionAccess $orgu_access, int $prg_ref_id)
mayAnyOf(array $operations)
ilOrgUnitPositionAccess $orgu_access
ilObjectDataCache $data_cache
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getUserIdsSusceptibleTo(string $operation)
ilOrgUnitGlobalSettings $orgu_settings
const ROLEPERM_MANAGE_MEMBERS
filterUserIds(array $user_ids, string $operation)
throwForInvalidOperation(string $operation)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...