ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjCloudAccess Class Reference

Class ilObjCloudAccess. More...

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

Public Member Functions

 _getCommands ()
 get commands More...
 
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 
 _checkGoto ($a_target)
 
- 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...
 

Static Public Member Functions

static checkOnline ($a_id)
 
static checkAuthStatus ($a_id)
 
- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. 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 40 of file class.ilObjCloudAccess.php.

41 {
42 global $ilUser, $rbacsystem, $rbacreview;
43
44 $object = new ilObjCloud($a_ref_id);
45
49 try
50 {
51 ilCloudConnector::checkServiceActive($object->getServiceName());
52 } catch (Exception $e)
53 {
54 return false;
55 }
56
57
58 if ($a_user_id == "")
59 {
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 {
69 return false;
70 }
71
72 switch ($a_permission)
73 {
74 case "visible":
75 case "read":
76 if (!ilObjCloudAccess::checkOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, "write", $a_ref_id))
77 {
78 return false;
79 }
80 break;
81 }
82 return true;
83
84 }
static checkServiceActive($name)
Class ilObjCloud.
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ _checkGoto()

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

Reimplemented from ilObjectAccess.

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

91 {
92
93 global $ilAccess;
94
95 $t_arr = explode("_", $a_target);
96
97 if ($ilAccess->checkAccess("read", "", $t_arr[1]))
98 {
99 return true;
100 }
101 return false;
102 }

◆ _getCommands()

ilObjCloudAccess::_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 20 of file class.ilObjCloudAccess.php.

21 {
22 $commands = array
23 (
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 }

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

130 {
131 global $ilDB;
132
133 if (!isset(self::$access_cache[$a_id]["auth_status"]))
134 {
135 $set = $ilDB->query("SELECT auth_complete FROM il_cld_data " .
136 " WHERE id = " . $ilDB->quote($a_id, "integer")
137 );
138 $rec = $ilDB->fetchAssoc($set);
139 self::$access_cache[$a_id]["auth_status"] = (boolean)$rec["auth_complete"];
140 }
141 return self::$access_cache[$a_id]["auth_status"];
142
143 }
global $ilDB

References $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 108 of file class.ilObjCloudAccess.php.

109 {
110 global $ilDB;
111
112 if(!isset(self::$access_cache[$a_id]["online"]))
113 {
114 $set = $ilDB->query("SELECT is_online FROM il_cld_data " .
115 " WHERE id = " . $ilDB->quote($a_id, "integer")
116 );
117 $rec = $ilDB->fetchAssoc($set);
118 self::$access_cache[$a_id]["online"] = (boolean)($rec["is_online"]);
119 }
120 return self::$access_cache[$a_id]["online"];
121
122
123 }

References $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: