Inheritance diagram for ilObjCourseAccess:
Collaboration diagram for ilObjCourseAccess: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 () | |
| get commands | |
Definition at line 35 of file class.ilObjCourseAccess.php.
| ilObjCourseAccess::_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)
| string | $a_cmd command (not permission!) | |
| string | $a_permission permission | |
| int | $a_ref_id reference id | |
| int | $a_obj_id object id | |
| int | $a_user_id user id (if not provided, current user is taken) |
Reimplemented from ilObjectAccess.
Definition at line 49 of file class.ilObjCourseAccess.php.
References $ilAccess, $ilias, $ilUser, $lng, $rbacsystem, ilObjCourse::_isActivated(), ilCourseMembers::_isBlocked(), and ilCourseMembers::_isMember().
{
global $ilUser, $lng, $rbacsystem, $ilAccess, $ilias;
if ($a_user_id == "")
{
$a_user_id = $ilUser->getId();
}
switch ($a_cmd)
{
case "view":
include_once 'course/classes/class.ilCourseMembers.php';
if(ilCourseMembers::_isBlocked($a_obj_id,$a_user_id))
{
$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("crs_status_blocked"));
return false;
}
break;
case "info":
include_once 'course/classes/class.ilCourseMembers.php';
if(ilCourseMembers::_isMember($a_user_id,$a_obj_id))
{
$ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("info_is_member"));
}
else
{
$ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("info_is_not_member"));
}
break;
case 'join':
include_once 'course/classes/class.ilCourseMembers.php';
if(ilCourseMembers::_isMember($a_user_id,$a_obj_id))
{
return false;
}
break;
case 'details':
include_once 'course/classes/class.ilCourseMembers.php';
// No details button if user is member
if(ilCourseMembers::_isMember($a_user_id,$a_obj_id))
{
return false;
}
// No details button if user has join permission
if($rbacsystem->checkAccessOfUser($a_user_id,'join',$a_ref_id))
{
return false;
}
break;
}
switch ($a_permission)
{
case "visible":
include_once 'course/classes/class.ilObjCourse.php';
if(!($activated = ilObjCourse::_isActivated($a_obj_id)))
{
$ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
}
else
{
$ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
}
if(!$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id) and !$activated)
{
return false;
}
break;
}
return true;
}
Here is the call graph for this function:| ilObjCourseAccess::_getCommands | ( | ) |
get commands
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"), );
Reimplemented from ilObjectAccess.
Definition at line 142 of file class.ilObjCourseAccess.php.
Referenced by ilObjCourseListGUI::init().
{
$commands = array
(
array("permission" => "read", "cmd" => "view", "lang_var" => "view",
"default" => true),
array("permission" => "join", "cmd" => "join", "lang_var" => "join"),
array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"),
array('permission' => 'visible', 'cmd' => 'details','lang_var' => 'crs_info')
);
return $commands;
}
Here is the caller graph for this function:
1.7.1