2 require_once
'Modules/IndividualAssessment/interfaces/AccessControl/interface.IndividualAssessmentAccessHandler.php';
3 require_once
'Services/AccessControl/classes/class.ilObjRole.php';
49 $this->mass_global_permissions_cache = array();
57 if ($operation ==
"read_learning_progress") {
58 return $this->handler->checkRbacOrPositionPermissionAccess(
"read_learning_progress",
"read_learning_progress", $this->iass->getRefId());
60 if ($operation ==
"edit_learning_progress") {
61 return $this->handler->checkRbacOrPositionPermissionAccess(
"edit_learning_progress",
"write_learning_progress", $this->iass->getRefId());
64 return $this->handler->checkAccessOfUser($this->usr->getId(), $operation,
'', $this->iass->getRefId(),
'iass');
74 "Admin of iass obj_no." . $iass->
getId(),
98 return self::DEFAULT_ROLE .
'_' . $iass->
getRefId();
103 return current($this->review->getLocalRoles($iass->
getRefId()));
212 || ($this->
mayGradeUser() && count($this->handler->filterUserIdsByRbacOrPositionOfCurrentUser(
"edit_learning_progress",
"set_lp", $this->iass->getRefId(), [$a_user_id])) > 0);
223 $usr_id = $this->usr->getId();
224 $obj_id = $this->iass->getId();
225 $ref_id = $this->iass->getRefId();
227 $this->handler->checkAccessOfUser($usr_id,
"edit_members",
'', $ref_id,
'iass')
228 || $this->handler->checkAccessOfUser($usr_id,
"read_learning_progress",
'', $ref_id,
'iass')
229 || $this->handler->checkAccessOfUser($usr_id,
"write_learning_progress",
'', $ref_id,
'iass')
235 if (!$orgu_settings->isPositionAccessActiveForObject($obj_id)) {
239 $viewable_users = $this->handler->filterUserIdsByPositionOfCurrentUser(
"read_learning_progress", $ref_id, $a_user_ids);
240 $gradeable_users = $this->handler->filterUserIdsByPositionOfCurrentUser(
"write_learning_progress", $ref_id, $a_user_ids);
242 return array_unique(array_merge($viewable_users, $gradeable_users));
270 $iass_id = $this->iass->getId();
271 $user_id = $this->usr->getId();
273 if (!isset($this->mass_global_permissions_cache[$iass_id][$user_id][$operation])) {
274 $this->mass_global_permissions_cache[$iass_id][$user_id][$operation]
278 return $this->mass_global_permissions_cache[$iass_id][$user_id][$operation];
288 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.
For the purpose of streamlining the grading and learning-process status definition outside of tests...
isSystemAdmin()
Check whether user is system admin.
$mass_global_permissions_cache
mayGradeUserById($a_user_id)
User may grade.
Mechanic regarding the access controll and roles of an objcet goes here.
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
mayViewUser($use_cache=true)
User may view gradings.
Interface ilAccessHandler.
__construct(ilObjIndividualAssessment $iass, ilAccessHandler $handler, ilRbacAdmin $admin, ilRbacReview $review, ilObjUser $usr)
static getInstance()
Get instance.
filterViewableOrGradeableUsers(array $a_user_ids)
Filter out users that may be graded or viewed.
getId()
get object id public
checkAccessToObj($operation)
Can an user perform an operation on some Individual assessment?bool
mayAmendGradeUser($use_cache=true)
User may Amend grading.
initDefaultRolesForObject(ilObjIndividualAssessment $iass)
Create default roles at an object.
mayViewObject($use_cache=true)
User view iass object.
getRefId()
get reference id public
cacheCheckAccessToObj($operation)
Get permission state from cache.
mayEditObject($use_cache=true)
User edit iass.
mayGradeUser($use_cache=true)
User may grade.
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.
mayEditPermissions($use_cache=true)
User edit permissions.
getMemberRoleIdForObj(ilObjIndividualAssessment $iass)
mayEditMembers($use_cache=true)
User may edit members.
class ilRbacReview Contains Review functions of core Rbac.