19 declare(strict_types=1);
57 $this->handler->checkAccessOfUser($this->usr->getId(), $operation,
'', $this->iass->getRefId(),
'iass');
67 if ($operation ==
"read_learning_progress") {
68 return $this->handler->checkRbacOrPositionPermissionAccess(
69 "read_learning_progress",
70 "read_learning_progress",
71 $this->iass->getRefId()
75 if ($operation ==
"write_learning_progress") {
76 return $this->handler->checkRbacOrPositionPermissionAccess(
80 "read_learning_progress",
81 "write_learning_progress",
82 $this->iass->getRefId()
86 throw new \LogicException(
"Unknown rbac/position-operation: $operation");
92 return $settings->isActive() &&
93 $settings->getContainer() === $this->iass->getParentContainerIdByType($this->iass->getRefId(), [
'crs']);
98 $ref_id = $this->iass->getRefId();
99 $roles = array_filter(
100 $this->review->getParentRoleIds(
$ref_id),
101 static fn(array $role):
bool => str_starts_with($role[
'title'],
'il_crs_member_')
106 $role = array_shift($roles);
107 $active_ops = $this->review->getActiveOperationsOfRole(
$ref_id, $role[
'rol_id']);
108 foreach($active_ops as $op) {
109 if($this->review->getOperation($op)[
'operation'] === $operation) {
123 "Admin of iass obj_no." . $iass->
getId(),
149 return self::DEFAULT_ROLE .
'_' . $iass->
getRefId();
157 return current($this->review->getLocalRoles($iass->
getRefId()));
199 $this->handler->filterUserIdsByRbacOrPositionOfCurrentUser(
203 "read_learning_progress",
204 "write_learning_progress",
205 $this->iass->getRefId(),
216 $this->handler->filterUserIdsByRbacOrPositionOfCurrentUser(
217 "read_learning_progress",
218 "read_learning_progress",
219 $this->iass->getRefId(),
232 return $this->review->isAssigned($this->usr->getId(),
SYSTEM_ROLE_ID);
Deal with ilias rbac-system.
assignUserToMemberRole(ilObjUser $usr, ilObjIndividualAssessment $iass)
Assign a user to the member role at an Individual assessment.
checkMemberRoleForPermission(string $operation)
checkRBACOrPositionAccessToObj(string $operation)
mayGradeUser(int $user_id)
For the purpose of streamlining the grading and learning-process status definition outside of tests...
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
ilObjIndividualAssessment $iass
Mechanic regarding the access control and roles of an objet goes here.
__construct(ilObjIndividualAssessment $iass, ilAccessHandler $handler, ilRbacAdmin $admin, ilRbacReview $review, ilObjUser $usr)
checkRBACAccessToObj(string $operation)
initDefaultRolesForObject(ilObjIndividualAssessment $iass)
Create default roles at an object.
mayEditLearningProgressSettings()
deassignUserFromMemberRole(ilObjUser $usr, ilObjIndividualAssessment $iass)
Deasign a user from the member role at an Individual assessment.
getRoleTitleByObj(ilObjIndividualAssessment $iass)
Class ilRbacAdmin Core functions for role based access control.
getMemberRoleIdForObj(ilObjIndividualAssessment $iass)
mayViewUser(int $user_id)