ILIAS  release_8 Revision v8.24
ilIndividualAssessmentAccessHandler Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilIndividualAssessmentAccessHandler:
+ Collaboration diagram for ilIndividualAssessmentAccessHandler:

Public Member Functions

 __construct (ilObjIndividualAssessment $iass, ilAccessHandler $handler, ilRbacAdmin $admin, ilRbacReview $review, ilObjUser $usr)
 
 checkRBACAccessToObj (string $operation)
 
 checkRBACOrPositionAccessToObj (string $operation)
 
 initDefaultRolesForObject (ilObjIndividualAssessment $iass)
 Create default roles at an object. More...
 
 assignUserToMemberRole (ilObjUser $usr, ilObjIndividualAssessment $iass)
 Assign a user to the member role at an Individual assessment. More...
 
 deassignUserFromMemberRole (ilObjUser $usr, ilObjIndividualAssessment $iass)
 Deasign a user from the member role at an Individual assessment. More...
 
 mayReadObject ()
 
 mayEditObject ()
 
 mayEditPermissions ()
 
 mayEditMembers ()
 
 mayViewAnyUser ()
 
 mayViewAllUsers ()
 
 mayGradeAnyUser ()
 
 mayGradeAllUsers ()
 
 mayGradeUser (int $user_id)
 
 mayViewUser (int $user_id)
 
 mayAmendAllUsers ()
 
 isSystemAdmin ()
 
 initDefaultRolesForObject (ilObjIndividualAssessment $iass)
 Create default roles at an object. More...
 
 assignUserToMemberRole (ilObjUser $usr, ilObjIndividualAssessment $iass)
 Assign a user to the member role at an Individual assessment. More...
 
 deassignUserFromMemberRole (ilObjUser $usr, ilObjIndividualAssessment $iass)
 Deasign a user from the member role at an Individual assessment. More...
 
 mayReadObject ()
 
 mayEditObject ()
 
 mayEditPermissions ()
 
 mayEditMembers ()
 
 mayViewAnyUser ()
 
 mayViewAllUsers ()
 
 mayGradeAnyUser ()
 
 mayGradeAllUsers ()
 
 mayGradeUser (int $user_id)
 
 mayViewUser (int $user_id)
 
 mayAmendAllUsers ()
 
 isSystemAdmin ()
 

Data Fields

const DEFAULT_ROLE = 'il_iass_member'
 

Protected Member Functions

 getRoleTitleByObj (ilObjIndividualAssessment $iass)
 
 getMemberRoleIdForObj (ilObjIndividualAssessment $iass)
 

Protected Attributes

ilObjIndividualAssessment $iass
 
ilAccessHandler $handler
 
ilRbacAdmin $admin
 
ilRbacReview $review
 
ilObjUser $usr
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Deal with ilias rbac-system

Definition at line 24 of file class.ilIndividualAssessmentAccessHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentAccessHandler::__construct ( ilObjIndividualAssessment  $iass,
ilAccessHandler  $handler,
ilRbacAdmin  $admin,
ilRbacReview  $review,
ilObjUser  $usr 
)

Member Function Documentation

◆ assignUserToMemberRole()

ilIndividualAssessmentAccessHandler::assignUserToMemberRole ( ilObjUser  $usr,
ilObjIndividualAssessment  $iass 
)

Assign a user to the member role at an Individual assessment.

Implements IndividualAssessmentAccessHandler.

Definition at line 97 of file class.ilIndividualAssessmentAccessHandler.php.

97 : bool
98 {
99 $this->admin->assignUser($this->getMemberRoleIdForObj($iass), $usr->getId());
100 return true;
101 }

References $usr, ilObject\getId(), and getMemberRoleIdForObj().

+ Here is the call graph for this function:

◆ checkRBACAccessToObj()

ilIndividualAssessmentAccessHandler::checkRBACAccessToObj ( string  $operation)

Definition at line 51 of file class.ilIndividualAssessmentAccessHandler.php.

51 : bool
52 {
53 return $this->isSystemAdmin() || $this->handler->checkAccessOfUser($this->usr->getId(), $operation, '', $this->iass->getRefId(), 'iass');
54 }

References isSystemAdmin().

Referenced by mayAmendAllUsers(), mayEditMembers(), mayEditObject(), mayEditPermissions(), mayGradeAllUsers(), mayReadObject(), and mayViewAllUsers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRBACOrPositionAccessToObj()

ilIndividualAssessmentAccessHandler::checkRBACOrPositionAccessToObj ( string  $operation)

Definition at line 56 of file class.ilIndividualAssessmentAccessHandler.php.

57 {
58 if ($this->isSystemAdmin()) {
59 return true;
60 }
61
62 if ($operation == "read_learning_progress") {
63 return $this->handler->checkRbacOrPositionPermissionAccess(
64 "read_learning_progress",
65 "read_learning_progress",
66 $this->iass->getRefId()
67 );
68 }
69
70 if ($operation == "edit_learning_progress") {
71 return $this->handler->checkRbacOrPositionPermissionAccess(
72 "edit_learning_progress",
73 "write_learning_progress",
74 $this->iass->getRefId()
75 );
76 }
77
78 throw new \LogicException("Unknown rbac/position-operation: $operation");
79 }

References isSystemAdmin().

Referenced by mayGradeAnyUser(), and mayViewAnyUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deassignUserFromMemberRole()

ilIndividualAssessmentAccessHandler::deassignUserFromMemberRole ( ilObjUser  $usr,
ilObjIndividualAssessment  $iass 
)

Deasign a user from the member role at an Individual assessment.

Implements IndividualAssessmentAccessHandler.

Definition at line 106 of file class.ilIndividualAssessmentAccessHandler.php.

106 : bool
107 {
108 $this->admin->deassignUser($this->getMemberRoleIdForObj($iass), $usr->getId());
109 return true;
110 }

References $usr, ilObject\getId(), and getMemberRoleIdForObj().

+ Here is the call graph for this function:

◆ getMemberRoleIdForObj()

ilIndividualAssessmentAccessHandler::getMemberRoleIdForObj ( ilObjIndividualAssessment  $iass)
protected
Returns
false|mixed

Definition at line 120 of file class.ilIndividualAssessmentAccessHandler.php.

121 {
122 return current($this->review->getLocalRoles($iass->getRefId()));
123 }

References $iass, and ilObject\getRefId().

Referenced by assignUserToMemberRole(), and deassignUserFromMemberRole().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRoleTitleByObj()

ilIndividualAssessmentAccessHandler::getRoleTitleByObj ( ilObjIndividualAssessment  $iass)
protected

Definition at line 112 of file class.ilIndividualAssessmentAccessHandler.php.

112 : string
113 {
114 return self::DEFAULT_ROLE . '_' . $iass->getRefId();
115 }

References $iass, and ilObject\getRefId().

Referenced by initDefaultRolesForObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRolesForObject()

ilIndividualAssessmentAccessHandler::initDefaultRolesForObject ( ilObjIndividualAssessment  $iass)

Create default roles at an object.

Implements IndividualAssessmentAccessHandler.

Definition at line 84 of file class.ilIndividualAssessmentAccessHandler.php.

84 : void
85 {
87 $this->getRoleTitleByObj($iass),
88 "Admin of iass obj_no." . $iass->getId(),
89 self::DEFAULT_ROLE,
91 );
92 }
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)

References $iass, ilObjRole\createDefaultRole(), ilObject\getId(), ilObject\getRefId(), and getRoleTitleByObj().

+ Here is the call graph for this function:

◆ isSystemAdmin()

ilIndividualAssessmentAccessHandler::isSystemAdmin ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 200 of file class.ilIndividualAssessmentAccessHandler.php.

200 : bool
201 {
202 return $this->review->isAssigned($this->usr->getId(), SYSTEM_ROLE_ID);
203 }
const SYSTEM_ROLE_ID
Definition: constants.php:29

References SYSTEM_ROLE_ID.

Referenced by checkRBACAccessToObj(), and checkRBACOrPositionAccessToObj().

+ Here is the caller graph for this function:

◆ mayAmendAllUsers()

ilIndividualAssessmentAccessHandler::mayAmendAllUsers ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 195 of file class.ilIndividualAssessmentAccessHandler.php.

195 : bool
196 {
197 return $this->checkRBACAccessToObj('amend_grading');
198 }

References checkRBACAccessToObj().

+ Here is the call graph for this function:

◆ mayEditMembers()

ilIndividualAssessmentAccessHandler::mayEditMembers ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 140 of file class.ilIndividualAssessmentAccessHandler.php.

140 : bool
141 {
142 return $this->checkRBACAccessToObj('edit_members');
143 }

References checkRBACAccessToObj().

+ Here is the call graph for this function:

◆ mayEditObject()

ilIndividualAssessmentAccessHandler::mayEditObject ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 130 of file class.ilIndividualAssessmentAccessHandler.php.

130 : bool
131 {
132 return $this->checkRBACAccessToObj('write');
133 }

References checkRBACAccessToObj().

+ Here is the call graph for this function:

◆ mayEditPermissions()

ilIndividualAssessmentAccessHandler::mayEditPermissions ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 135 of file class.ilIndividualAssessmentAccessHandler.php.

135 : bool
136 {
137 return $this->checkRBACAccessToObj('edit_permission');
138 }

References checkRBACAccessToObj().

+ Here is the call graph for this function:

◆ mayGradeAllUsers()

ilIndividualAssessmentAccessHandler::mayGradeAllUsers ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 162 of file class.ilIndividualAssessmentAccessHandler.php.

162 : bool
163 {
164 return $this->checkRBACAccessToObj('edit_learning_progress');
165 }

References checkRBACAccessToObj().

Referenced by mayGradeAnyUser(), and mayGradeUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayGradeAnyUser()

ilIndividualAssessmentAccessHandler::mayGradeAnyUser ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 157 of file class.ilIndividualAssessmentAccessHandler.php.

157 : bool
158 {
159 return $this->mayGradeAllUsers() || $this->checkRBACOrPositionAccessToObj('edit_learning_progress');
160 }

References checkRBACOrPositionAccessToObj(), and mayGradeAllUsers().

+ Here is the call graph for this function:

◆ mayGradeUser()

ilIndividualAssessmentAccessHandler::mayGradeUser ( int  $user_id)

Implements IndividualAssessmentAccessHandler.

Definition at line 167 of file class.ilIndividualAssessmentAccessHandler.php.

167 : bool
168 {
169 return
170 $this->mayGradeAllUsers() ||
171 (count(
172 $this->handler->filterUserIdsByRbacOrPositionOfCurrentUser(
173 "edit_learning_progress",
174 "write_learning_progress",
175 $this->iass->getRefId(),
176 [$user_id]
177 )
178 ) > 0);
179 }

References mayGradeAllUsers().

+ Here is the call graph for this function:

◆ mayReadObject()

ilIndividualAssessmentAccessHandler::mayReadObject ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 125 of file class.ilIndividualAssessmentAccessHandler.php.

125 : bool
126 {
127 return $this->checkRBACAccessToObj('read');
128 }

References checkRBACAccessToObj().

+ Here is the call graph for this function:

◆ mayViewAllUsers()

ilIndividualAssessmentAccessHandler::mayViewAllUsers ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 152 of file class.ilIndividualAssessmentAccessHandler.php.

152 : bool
153 {
154 return $this->checkRBACAccessToObj('read_learning_progress');
155 }

References checkRBACAccessToObj().

Referenced by mayViewAnyUser(), and mayViewUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayViewAnyUser()

ilIndividualAssessmentAccessHandler::mayViewAnyUser ( )

Implements IndividualAssessmentAccessHandler.

Definition at line 145 of file class.ilIndividualAssessmentAccessHandler.php.

145 : bool
146 {
147 return $this->mayViewAllUsers()
148 || $this->checkRBACOrPositionAccessToObj('read_learning_progress')
149 || $this->checkRBACOrPositionAccessToObj('edit_learning_progress');
150 }

References checkRBACOrPositionAccessToObj(), and mayViewAllUsers().

+ Here is the call graph for this function:

◆ mayViewUser()

ilIndividualAssessmentAccessHandler::mayViewUser ( int  $user_id)

Implements IndividualAssessmentAccessHandler.

Definition at line 181 of file class.ilIndividualAssessmentAccessHandler.php.

181 : bool
182 {
183 return
184 $this->mayViewAllUsers() ||
185 (count(
186 $this->handler->filterUserIdsByRbacOrPositionOfCurrentUser(
187 "read_learning_progress",
188 "read_learning_progress",
189 $this->iass->getRefId(),
190 [$user_id]
191 )
192 ) > 0);
193 }

References mayViewAllUsers().

+ Here is the call graph for this function:

Field Documentation

◆ $admin

ilRbacAdmin ilIndividualAssessmentAccessHandler::$admin
protected

Definition at line 30 of file class.ilIndividualAssessmentAccessHandler.php.

Referenced by __construct().

◆ $handler

ilAccessHandler ilIndividualAssessmentAccessHandler::$handler
protected

Definition at line 29 of file class.ilIndividualAssessmentAccessHandler.php.

Referenced by __construct().

◆ $iass

ilObjIndividualAssessment ilIndividualAssessmentAccessHandler::$iass
protected

◆ $review

ilRbacReview ilIndividualAssessmentAccessHandler::$review
protected

Definition at line 31 of file class.ilIndividualAssessmentAccessHandler.php.

Referenced by __construct().

◆ $usr

ilObjUser ilIndividualAssessmentAccessHandler::$usr
protected

◆ DEFAULT_ROLE

const ilIndividualAssessmentAccessHandler::DEFAULT_ROLE = 'il_iass_member'

The documentation for this class was generated from the following file: