ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjCloudAccess Class Reference

Class ilObjCloudAccess. More...

+ Inheritance diagram for ilObjCloudAccess:
+ Collaboration diagram for ilObjCloudAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 
- 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...
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 
static checkOnline ($a_id)
 
static checkAuthStatus ($a_id)
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Static Protected Attributes

static $access_cache = array()
 

Detailed Description

Member Function Documentation

◆ _checkAccess()

ilObjCloudAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)
Parameters
string$a_cmd
string$a_permission
int$a_ref_id
int$a_obj_id
string$a_user_id
Returns
bool

Check if plugin of object is active

Check if authentication is complete. If not, only the owner of the object has access. This prevents the authentication of an account which does not belong to the owner.

Reimplemented from ilObjectAccess.

Definition at line 39 of file class.ilObjCloudAccess.php.

39 {
40 global $DIC;
41 $ilUser = $DIC['ilUser'];
42 $rbacsystem = $DIC['rbacsystem'];
43 $rbacreview = $DIC['rbacreview'];
44
45 $object = new ilObjCloud($a_ref_id);
46
50 try {
51 ilCloudConnector::checkServiceActive($object->getServiceName());
52 } catch (Exception $e) {
53 return false;
54 }
55
56 if ($a_user_id == "") {
57 $a_user_id = $ilUser->getId();
58 }
59
64 if (!ilObjCloudAccess::checkAuthStatus($a_obj_id) && $a_user_id != $object->getOwnerId() && !$rbacreview->isAssigned($a_user_id, 2)) {
65 return false;
66 }
67
68 switch ($a_permission) {
69 case "visible":
70 case "read":
71 if (!ilObjCloudAccess::checkOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, "write", $a_ref_id)) {
72 return false;
73 }
74 break;
75 }
76
77 return true;
78 }
static checkServiceActive($name)
Class ilObjCloud.
global $DIC
$ilUser
Definition: imgupload.php:18

References $DIC, $ilUser, checkAuthStatus(), checkOnline(), and ilCloudConnector\checkServiceActive().

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjCloudAccess::_checkGoto (   $a_target)
static
Parameters
$a_target
Returns
bool

Reimplemented from ilObjectAccess.

Definition at line 85 of file class.ilObjCloudAccess.php.

85 {
86
87 global $DIC;
88 $ilAccess = $DIC['ilAccess'];
89
90 $t_arr = explode("_", $a_target);
91
92 if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
93 return true;
94 }
95
96 return false;
97 }

References $DIC.

◆ _getCommands()

static ilObjCloudAccess::_getCommands ( )
static

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 21 of file class.ilObjCloudAccess.php.

21 {
22 $commands = array(
23 array( "permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true ),
24 array( "permission" => "write", "cmd" => "editSettings", "lang_var" => "settings" ),
25 );
26
27 return $commands;
28 }

Referenced by ilObjCloudListGUI\init().

+ Here is the caller graph for this function:

◆ checkAuthStatus()

static ilObjCloudAccess::checkAuthStatus (   $a_id)
static
Parameters
$a_id
Returns
mixed

Definition at line 122 of file class.ilObjCloudAccess.php.

122 {
123 global $DIC;
124 $ilDB = $DIC['ilDB'];
125
126 if (!isset(self::$access_cache[$a_id]["auth_status"])) {
127 $set = $ilDB->query("SELECT auth_complete FROM il_cld_data " . " WHERE id = " . $ilDB->quote($a_id, "integer"));
128 $rec = $ilDB->fetchAssoc($set);
129 self::$access_cache[$a_id]["auth_status"] = (boolean)$rec["auth_complete"];
130 }
131
132 return self::$access_cache[$a_id]["auth_status"];
133 }
global $ilDB

References $DIC, and $ilDB.

Referenced by _checkAccess(), and ilObjCloudListGUI\getProperties().

+ Here is the caller graph for this function:

◆ checkOnline()

static ilObjCloudAccess::checkOnline (   $a_id)
static
Parameters
$a_id
Returns
mixed

Definition at line 104 of file class.ilObjCloudAccess.php.

104 {
105 global $DIC;
106 $ilDB = $DIC['ilDB'];
107
108 if (!isset(self::$access_cache[$a_id]["online"])) {
109 $set = $ilDB->query("SELECT is_online FROM il_cld_data " . " WHERE id = " . $ilDB->quote($a_id, "integer"));
110 $rec = $ilDB->fetchAssoc($set);
111 self::$access_cache[$a_id]["online"] = (boolean)($rec["is_online"]);
112 }
113
114 return self::$access_cache[$a_id]["online"];
115 }

References $DIC, and $ilDB.

Referenced by _checkAccess(), and ilObjCloudListGUI\getProperties().

+ Here is the caller graph for this function:

Field Documentation

◆ $access_cache

ilObjCloudAccess::$access_cache = array()
staticprotected

Definition at line 18 of file class.ilObjCloudAccess.php.


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