ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilIndividualAssessmentAccessHandler Class Reference

Deal with ilias rbac-system More...

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

Public Member Functions

 __construct (ilAccessHandler $handler, ilRbacAdmin $admin, ilRbacReview $review, ilObjUser $usr)
 
 checkAccessToObj (ilObjIndividualAssessment $iass, $operation)
 Can the current ilias user perform an operation on some Individual assessment? More...
 
 checkAccessOfUserToObj (ilObjUser $usr, ilObjIndividualAssessment $iass, $operation)
 Can an user perform an operation on some Individual assessment?
Parameters
ilObjUser$usr
ilObjIndividualAssessment$iass
string$operation
Returns
bool
More...
 
 initDefaultRolesForObject (ilObjIndividualAssessment $iass)
 Create default roles at an object.
Parameters
ilObjIndividualAssessment$iass
More...
 
 assignUserToMemberRole (ilObjUser $usr, ilObjIndividualAssessment $iass)
 Assign a user to the member role at an Individual assessment.
Parameters
ilObjIndividualAssessment$iass
ilObjUser$usr
More...
 
 deassignUserFromMemberRole (ilObjUser $usr, ilObjIndividualAssessment $iass)
 Deasign a user from the member role at an Individual assessment.
Parameters
ilObjIndividualAssessment$iass
ilObjUser$usr
More...
 

Data Fields

const DEFAULT_ROLE = 'il_iass_member'
 

Protected Member Functions

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

Protected Attributes

 $handler
 
 $admin
 
 $review
 

Detailed Description

Deal with ilias rbac-system

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

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentAccessHandler::__construct ( 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.

Parameters
ilObjIndividualAssessment$iass
ilObjUser$usr

Implements IndividualAssessmentAccessHandler.

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

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

57  {
58  return $this->admin->assignUser($this->getMemberRoleIdForObj($iass),$usr->getId());
59  }
getId()
get object id public
+ Here is the call graph for this function:

◆ checkAccessOfUserToObj()

ilIndividualAssessmentAccessHandler::checkAccessOfUserToObj ( ilObjUser  $usr,
ilObjIndividualAssessment  $iass,
  $operation 
)

Can an user perform an operation on some Individual assessment?

Parameters
ilObjUser$usr
ilObjIndividualAssessment$iass
string$operation
Returns
bool

Implements IndividualAssessmentAccessHandler.

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

References ilObject\getId(), and ilObject\getRefId().

Referenced by checkAccessToObj().

37  {
38 
39  return $this->handler->checkAccessOfUser($usr->getId(), $operation, '', $iass->getRefId(), 'iass');
40  }
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkAccessToObj()

ilIndividualAssessmentAccessHandler::checkAccessToObj ( ilObjIndividualAssessment  $iass,
  $operation 
)

Can the current ilias user perform an operation on some Individual assessment?

Parameters
ilObjIndividualAssessment$iass
string$operation
Returns
bool

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

References checkAccessOfUserToObj().

30  {
31  return $this->checkAccessOfUserToObj($this->usr,$iass,$operation);
32  }
checkAccessOfUserToObj(ilObjUser $usr, ilObjIndividualAssessment $iass, $operation)
Can an user perform an operation on some Individual assessment?bool
+ Here is the call graph for this function:

◆ deassignUserFromMemberRole()

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

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

Parameters
ilObjIndividualAssessment$iass
ilObjUser$usr

Implements IndividualAssessmentAccessHandler.

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

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

64  {
65  return $this->admin->deassignUser($this->getMemberRoleIdForObj($iass),$usr->getId());
66  }
getId()
get object id public
+ Here is the call graph for this function:

◆ getMemberRoleIdForObj()

ilIndividualAssessmentAccessHandler::getMemberRoleIdForObj ( ilObjIndividualAssessment  $iass)
protected

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

References ilObject\getRefId().

Referenced by assignUserToMemberRole(), and deassignUserFromMemberRole().

72  {
73  return current($this->review->getLocalRoles($iass->getRefId()));
74  }
getRefId()
get reference id public
+ 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 68 of file class.ilIndividualAssessmentAccessHandler.php.

References ilObject\getRefId().

Referenced by initDefaultRolesForObject().

68  {
69  return self::DEFAULT_ROLE.'_'.$iass->getRefId();
70  }
getRefId()
get reference id public
+ 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.

Parameters
ilObjIndividualAssessment$iass

Implements IndividualAssessmentAccessHandler.

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

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

45  {
47  $this->getRoleTitleByObj($iass),
48  "Admin of iass obj_no.".$iass->getId(),
49  self::DEFAULT_ROLE,
50  $iass->getRefId()
51  );
52  }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:

Field Documentation

◆ $admin

ilIndividualAssessmentAccessHandler::$admin
protected

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

Referenced by __construct().

◆ $handler

ilIndividualAssessmentAccessHandler::$handler
protected

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

Referenced by __construct().

◆ $review

ilIndividualAssessmentAccessHandler::$review
protected

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

Referenced by __construct().

◆ DEFAULT_ROLE

const ilIndividualAssessmentAccessHandler::DEFAULT_ROLE = 'il_iass_member'

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