ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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)
 _getCommands ($a_ref_id)
 get commands

Additional Inherited Members

- Static Public Member Functions inherited from ilContainerReferenceAccess
static _isAccessible ($a_ref_id)
 Check if target is accessible and not deleted.

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

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.

References $lng, ilObjCourse\_isActivated(), ilObject\_lookupObjId(), ilContainerReference\_lookupTargetRefId(), and IL_NO_OBJECT_ACCESS.

{
global $lng,$rbacsystem,$ilAccess;
switch($a_permission)
{
case 'visible':
case 'read':
include_once './Modules/CourseReference/classes/class.ilObjCourseReference.php';
$target_ref_id = ilObjCourseReference::_lookupTargetRefId($a_obj_id);
$target_obj_id = ilObject::_lookupObjId($target_ref_id);
include_once './Modules/Course/classes/class.ilObjCourse.php';
if((!ilObjCourse::_isActivated($target_obj_id) or !$rbacsystem->checkAccess('visible',$target_ref_id)) and
!$rbacsystem->checkAccess('write',$a_ref_id))
{
$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
return false;
}
}
return true;
}

+ Here is the call graph for this function:

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 93 of file class.ilObjCourseReferenceAccess.php.

References $GLOBALS, and ilObjectAccess\_getCommands().

{
global $ilAccess;
if(!isset($a_ref_id))
{
$GLOBALS['ilLog']->logStack();
}
if($ilAccess->checkAccess('write','',$a_ref_id))
{
// Only local (reference specific commands)
$commands = array
(
array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
);
}
else
{
include_once('./Modules/Course/classes/class.ilObjCourseAccess.php');
}
return $commands;
}

+ Here is the call graph for this function:


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