ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
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.

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

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

41  {
42  global $DIC;
43  $ilUser = $DIC['ilUser'];
44  $rbacsystem = $DIC['rbacsystem'];
45  $rbacreview = $DIC['rbacreview'];
46 
47  $object = new ilObjCloud($a_ref_id);
48 
52  try {
53  ilCloudConnector::checkServiceActive($object->getServiceName());
54  } catch (Exception $e) {
55  return false;
56  }
57 
58  if ($a_user_id == "") {
59  $a_user_id = $ilUser->getId();
60  }
61 
66  if (!ilObjCloudAccess::checkAuthStatus($a_obj_id) && $a_user_id != $object->getOwnerId() && !$rbacreview->isAssigned($a_user_id, 2)) {
67  return false;
68  }
69 
70  switch ($a_permission) {
71  case "visible":
72  case "read":
73  if (!ilObjCloudAccess::checkOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, "write", $a_ref_id)) {
74  return false;
75  }
76  break;
77  }
78 
79  return true;
80  }
global $DIC
Definition: saml.php:7
static checkServiceActive($name)
$ilUser
Definition: imgupload.php:18
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 87 of file class.ilObjCloudAccess.php.

References $DIC.

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

◆ _getCommands()

static ilObjCloudAccess::_getCommands ( )
static

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

References array.

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  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ checkAuthStatus()

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

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

References $DIC, and $ilDB.

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

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

◆ checkOnline()

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

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

References $DIC, and $ilDB.

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

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