ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjiLincClassroomAccess Class Reference

Class ilObjiLincClassroomAccess. More...

+ Inheritance diagram for ilObjiLincClassroomAccess:
+ Collaboration diagram for ilObjiLincClassroomAccess:

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()

ilObjiLincClassroomAccess::_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

ATTENTION ref_id contains ilinc classroom id obj_id contains ILIAS ref_id of iLinc Seminar user_id contains online status of classroom

Reimplemented from ilObjectAccess.

Definition at line 50 of file class.ilObjiLincClassroomAccess.php.

51 {
52 global $ilUser, $lng, $rbacsystem, $ilAccess, $ilias;
53
54 $user_id = $ilUser->getId();
55 $class_id = $a_ref_id;
56 $course_ref_id = $a_obj_id;
57 $class_arr = $a_user_id;
58//var_dump($a_cmd,$a_permission,$a_ref_id,$a_obj_id,$a_user_id);
64 switch ($a_cmd)
65 {
66
67 }
68
69 switch ($a_permission)
70 {
71 case 'join':
72 // Cannot join closed classrooms
73 if (!$class_arr['alwaysopen'])
74 {
75 return false;
76 }
77
78 // non members cannot join
79 include_once ('./Modules/ILinc/classes/class.ilObjiLincCourse.php');
80
81 if (!ilObjiLincCourse::_isMember($user_id,$a_ref_id))
82 {
83 return false;
84 }
85 break;
86
87 case "write":
88 case "delete":
89 if(!$rbacsystem->checkAccessOfUser($user_id,'write',$a_ref_id,"ilca"))
90 {
91 return false;
92 }
93 break;
94 }
95
96 return true;
97 }
_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 $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ _getCommands()

ilObjiLincClassroomAccess::_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 111 of file class.ilObjiLincClassroomAccess.php.

112 {
113 $commands = array
114 (
115 array("permission" => "join", "cmd" => "joinClassroom", "lang_var" => "join", "frame" => "_blank"),
116 array("permission" => "write", "cmd" => "editClassroom", "lang_var" => "edit"),
117 array("permission" => "delete", "cmd" => "removeClassroom", "lang_var" => "delete")
118 );
119
120 return $commands;
121 }

Referenced by ilObjiLincClassroomListGUI\init().

+ Here is the caller graph for this function:

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