19declare(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) {
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.
initDefaultRolesForObject(ilObjIndividualAssessment $iass)
Create default roles at an object.
checkRBACAccessToObj(string $operation)
mayGradeUser(int $user_id)
assignUserToMemberRole(ilObjUser $usr, ilObjIndividualAssessment $iass)
Assign a user to the member role at an Individual assessment.
mayViewUser(int $user_id)
checkMemberRoleForPermission(string $operation)
mayEditLearningProgressSettings()
getMemberRoleIdForObj(ilObjIndividualAssessment $iass)
getRoleTitleByObj(ilObjIndividualAssessment $iass)
__construct(ilObjIndividualAssessment $iass, ilAccessHandler $handler, ilRbacAdmin $admin, ilRbacReview $review, ilObjUser $usr)
checkRBACOrPositionAccessToObj(string $operation)
ilObjIndividualAssessment $iass
deassignUserFromMemberRole(ilObjUser $usr, ilObjIndividualAssessment $iass)
Deasign a user from the member role at an Individual assessment.
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)
Class ilRbacAdmin Core functions for role based access control.
class ilRbacReview Contains Review functions of core Rbac.
Mechanic regarding the access control and roles of an objet goes here.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...