ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjCourseReferenceAccess Class Reference
+ Inheritance diagram for ilObjCourseReferenceAccess:
+ Collaboration diagram for ilObjCourseReferenceAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _getCommands ($a_ref_id)
 get commands More...
 
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilContainerReferenceAccess
static _isAccessible ($a_ref_id)
 Check if target is accessible and not deleted. More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 36 of file class.ilObjCourseReferenceAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjCourseReferenceAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)

Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Reimplemented from ilContainerReferenceAccess.

Definition at line 53 of file class.ilObjCourseReferenceAccess.php.

54 {
55 global $ilAccess;
56
57 switch($a_permission)
58 {
59 case 'visible':
60 case 'read':
61 include_once './Modules/CourseReference/classes/class.ilObjCourseReference.php';
62 $target_ref_id = ilObjCourseReference::_lookupTargetRefId($a_obj_id);
63
64 if(!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id))
65 {
66 return false;
67 }
68 break;
69 }
70
71 return true;
72 }
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.

References ilContainerReference\_lookupTargetRefId().

+ Here is the call graph for this function:

◆ _getCommands()

ilObjCourseReferenceAccess::_getCommands (   $a_ref_id)

get commands

Depends on permissions

Parameters
int$a_ref_idReference id of course link

this method returns an array of all possible commands/permission combinations

example:
$commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Definition at line 90 of file class.ilObjCourseReferenceAccess.php.

91 {
92 global $ilAccess;
93
94 if($ilAccess->checkAccess('write','',$a_ref_id))
95 {
96 // Only local (reference specific commands)
97 $commands = array
98 (
99 array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
100 array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")
101 );
102 }
103 else
104 {
105 include_once('./Modules/Course/classes/class.ilObjCourseAccess.php');
107 }
108 return $commands;
109 }

References ilObjCourseAccess\_getCommands().

+ Here is the call graph for this function:

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