ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilObjiLincCourseAccess Class Reference

Class ilObjiLincCourseAccess. More...

+ Inheritance diagram for ilObjiLincCourseAccess:
+ Collaboration diagram for ilObjiLincCourseAccess:

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 ()
 get commands 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 ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Detailed Description

Member Function Documentation

◆ _checkAccess()

ilObjiLincCourseAccess::_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)

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

Definition at line 48 of file class.ilObjiLincCourseAccess.php.

References $ilUser, $lng, ilObjiLincCourse\_isActivated(), ilObjiLincCourse\_isMember(), and IL_NO_OBJECT_ACCESS.

49  {
50  global $ilUser, $lng, $rbacsystem, $ilAccess, $ilias;
51 
52  if ($a_user_id == "")
53  {
54  $a_user_id = $ilUser->getId();
55  }
56 
57  switch ($a_cmd)
58  {
59  case "info":
60  include_once './Modules/ILinc/classes/class.ilObjiLincCourse.php';
61 
62  if(ilObjiLincCourse::_isMember($a_user_id,$a_ref_id))
63  {
64  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("info_is_member"));
65  }
66  else
67  {
68  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("info_is_not_member"));
69  }
70  break;
71 
72  case 'join':
73  include_once './Modules/ILinc/classes/class.ilObjiLincCourse.php';
74 
75  if(ilObjiLincCourse::_isMember($a_user_id,$a_ref_id))
76  {
77  return false;
78  }
79  break;
80  }
81 
82  switch ($a_permission)
83  {
84  case "visible":
85  include_once './Modules/ILinc/classes/class.ilObjiLincCourse.php';
86 
87  if(!($activated = ilObjiLincCourse::_isActivated($a_obj_id)))
88  {
89  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
90  }
91  else
92  {
93  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
94  }
95 
96  if (!$ilias->getSetting("ilinc_active"))
97  {
98  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("ilinc_server_not_active"));
99  }
100 
101  if(!$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id) and !$activated)
102  {
103  return false;
104  }
105  break;
106  }
107 
108  return true;
109  }
_isActivated($a_course_obj_id)
const IL_NO_OBJECT_ACCESS
_isMember($a_user_id, $a_ref_id)
checks wether the user relating to the passed usr_id is member of iLinc course with passed ref_id ...
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ _getCommands()

ilObjiLincCourseAccess::_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"), );

Definition at line 123 of file class.ilObjiLincCourseAccess.php.

Referenced by ilObjiLincCourseListGUI\init().

124  {
125  $commands = array
126  (
127  array("permission" => "read", "cmd" => "view", "lang_var" => "view_rooms",
128  "default" => true),
129  array("permission" => "join", "cmd" => "join", "lang_var" => "join"),
130  array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
131  );
132 
133  return $commands;
134  }
+ Here is the caller graph for this function:

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