ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 

Static Public Member Functions

static _getCommands ()
 
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 if object type does not support centralized offline handling. 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.

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

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

42  {
43  global $DIC;
44  $ilUser = $DIC['ilUser'];
45  $rbacsystem = $DIC['rbacsystem'];
46  $rbacreview = $DIC['rbacreview'];
47 
48  $object = new ilObjCloud($a_ref_id);
49 
53  try {
54  ilCloudConnector::checkServiceActive($object->getServiceName());
55  } catch (Exception $e) {
56  return false;
57  }
58 
59  if ($a_user_id == "") {
60  $a_user_id = $ilUser->getId();
61  }
62 
67  if (!ilObjCloudAccess::checkAuthStatus($a_obj_id) && $a_user_id != $object->getOwnerId() && !$rbacreview->isAssigned($a_user_id, 2)) {
68  return false;
69  }
70 
71  switch ($a_permission) {
72  case "visible":
73  case "read":
74  if (!ilObjCloudAccess::checkOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, "write", $a_ref_id)) {
75  return false;
76  }
77  break;
78  }
79 
80  return true;
81  }
static checkServiceActive($name)
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
Class ilObjCloud.
+ Here is the call graph for this function:

◆ _checkGoto()

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

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

References $DIC.

90  {
91  global $DIC;
92  $ilAccess = $DIC['ilAccess'];
93 
94  $t_arr = explode("_", $a_target);
95 
96  if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
97  return true;
98  }
99 
100  return false;
101  }
$DIC
Definition: xapitoken.php:46

◆ _getCommands()

static ilObjCloudAccess::_getCommands ( )
static

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

Referenced by ilObjCloudListGUI\init().

22  {
23  $commands = array(
24  array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true),
25  array("permission" => "write", "cmd" => "editSettings", "lang_var" => "settings"),
26  );
27 
28  return $commands;
29  }
+ Here is the caller graph for this function:

◆ checkAuthStatus()

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

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

References $DIC, and $ilDB.

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

130  {
131  global $DIC;
132  $ilDB = $DIC['ilDB'];
133 
134  if (!isset(self::$access_cache[$a_id]["auth_status"])) {
135  $set = $ilDB->query("SELECT auth_complete FROM il_cld_data " . " WHERE id = " . $ilDB->quote($a_id, "integer"));
136  $rec = $ilDB->fetchAssoc($set);
137  self::$access_cache[$a_id]["auth_status"] = (boolean) $rec["auth_complete"];
138  }
139 
140  return self::$access_cache[$a_id]["auth_status"];
141  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ checkOnline()

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

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

References $DIC, and $ilDB.

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

110  {
111  global $DIC;
112  $ilDB = $DIC['ilDB'];
113 
114  if (!isset(self::$access_cache[$a_id]["online"])) {
115  $set = $ilDB->query("SELECT is_online FROM il_cld_data " . " WHERE id = " . $ilDB->quote($a_id, "integer"));
116  $rec = $ilDB->fetchAssoc($set);
117  self::$access_cache[$a_id]["online"] = (boolean) ($rec["is_online"]);
118  }
119 
120  return self::$access_cache[$a_id]["online"];
121  }
global $ilDB
$DIC
Definition: xapitoken.php:46
+ 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: