ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjMediaCastAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjMediaCastAccess:
+ Collaboration diagram for ilObjMediaCastAccess:

Public Member Functions

 __construct ()
 
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 
static _checkGoto (string $target)
 
static _lookupOnline (int $a_id)
 
static _lookupPublicFiles (int $a_id)
 
static _lookupDiskUsage (int $a_id)
 Returns the number of bytes used on the harddisk by the file object with the specified object id. More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Protected Attributes

ilObjUser $user
 
ilLanguage $lng
 
ilRbacSystem $rbacsystem
 
ilAccessHandler $access
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 22 of file class.ilObjMediaCastAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaCastAccess::__construct ( )

Definition at line 29 of file class.ilObjMediaCastAccess.php.

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

30  {
31  global $DIC;
32 
33  $this->user = $DIC->user();
34  $this->lng = $DIC->language();
35  $this->rbacsystem = $DIC->rbac()->system();
36  $this->access = $DIC->access();
37  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjMediaCastAccess::_checkAccess ( string  $cmd,
string  $permission,
int  $ref_id,
int  $obj_id,
?int  $user_id = null 
)

Definition at line 51 of file class.ilObjMediaCastAccess.php.

References $access, $ilUser, $lng, $rbacsystem, $user, _lookupOnline(), ilRbacSystem\checkAccessOfUser(), ilAccessInfo\IL_NO_OBJECT_ACCESS, ilAccessInfo\IL_STATUS_MESSAGE, and ilLanguage\txt().

51  : bool
52  {
54  $lng = $this->lng;
56  $ilAccess = $this->access;
57 
58  if (is_null($user_id)) {
59  $user_id = $ilUser->getId();
60  }
61 
62  switch ($cmd) {
63  case "listItems":
64 
66  && !$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id)) {
67  $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
68  return false;
69  }
70  break;
71 
72  // for permission query feature
73  case "infoScreen":
75  $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
76  } else {
77  $ilAccess->addInfoItem(ilAccessInfo::IL_STATUS_MESSAGE, $lng->txt("online"));
78  }
79  break;
80 
81  }
82  switch ($permission) {
83  case "read":
84  case "visible":
86  (!$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id))) {
87  $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
88  return false;
89  }
90  break;
91  }
92 
93  return true;
94  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
$ref_id
Definition: ltiauth.php:67
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjMediaCastAccess::_checkGoto ( string  $target)
static

Definition at line 96 of file class.ilObjMediaCastAccess.php.

References $DIC.

96  : bool
97  {
98  global $DIC;
99 
100  $ilAccess = $DIC->access();
101 
102  $t_arr = explode("_", $target);
103 
104  if ($t_arr[0] != "mcst" || ((int) $t_arr[1]) <= 0) {
105  return false;
106  }
107 
108  if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
109  $ilAccess->checkAccess("visible", "", $t_arr[1])) {
110  return true;
111  }
112  return false;
113  }
global $DIC
Definition: feed.php:28

◆ _getCommands()

static ilObjMediaCastAccess::_getCommands ( )
static

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

Referenced by ilObjMediaCastListGUI\init().

39  : array
40  {
41  $commands = array(
42  array("permission" => "read", "cmd" => "showContent", "lang_var" => "show",
43  "default" => true),
44  array("permission" => "write", "cmd" => "listItems", "lang_var" => "edit_content"),
45  array("permission" => "write", "cmd" => "editSettings", "lang_var" => "settings")
46  );
47 
48  return $commands;
49  }
+ Here is the caller graph for this function:

◆ _lookupDiskUsage()

static ilObjMediaCastAccess::_lookupDiskUsage ( int  $a_id)
static

Returns the number of bytes used on the harddisk by the file object with the specified object id.

Definition at line 145 of file class.ilObjMediaCastAccess.php.

References ilObjMediaObject\_getDirectory(), and ilFileUtils\dirsize().

145  : int
146  {
147  $obj = new ilObjMediaCast($a_id, false);
148  $obj->read();
149  $items = $obj->getItemsArray();
150  $size = 0;
151  foreach ($items as $item) {
152  $news_item = new ilNewsItem($item["id"]);
153  $news_item->read();
154  $mobId = $news_item->getMobId();
156  }
157  return $size;
158  }
static _getDirectory(int $a_mob_id)
Get absolute directory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static dirsize(string $directory)
get size of a directory or a file.
A news item can be created by different sources.
+ Here is the call graph for this function:

◆ _lookupOnline()

static ilObjMediaCastAccess::_lookupOnline ( int  $a_id)
static

Definition at line 115 of file class.ilObjMediaCastAccess.php.

References $DIC, $ilDB, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilObjectFeedWriter\__construct(), ilUserFeedWriter\__construct(), _checkAccess(), ilObjMediaCastListGUI\getProperties(), and ilContainer\legacyOnlineFilter().

115  : bool
116  {
117  global $DIC;
118 
119  $ilDB = $DIC->database();
120 
121  $q = "SELECT * FROM il_media_cast_data WHERE id = " . $ilDB->quote($a_id);
122  $mc_set = $ilDB->query($q);
123  $mc_rec = $mc_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
124 
125  return (bool) ($mc_rec["is_online"] ?? false);
126  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupPublicFiles()

static ilObjMediaCastAccess::_lookupPublicFiles ( int  $a_id)
static

Definition at line 128 of file class.ilObjMediaCastAccess.php.

References $DIC, $ilDB, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilObjectFeedWriter\__construct(), and ilObjMediaObjectAccess\checkAccessMob().

128  : bool
129  {
130  global $DIC;
131 
132  $ilDB = $DIC->database();
133 
134  $q = "SELECT * FROM il_media_cast_data WHERE id = " . $ilDB->quote($a_id);
135  $mc_set = $ilDB->query($q);
136  $mc_rec = $mc_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
137 
138  return (bool) $mc_rec["public_files"];
139  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjMediaCastAccess::$access
protected

Definition at line 27 of file class.ilObjMediaCastAccess.php.

Referenced by _checkAccess().

◆ $lng

ilLanguage ilObjMediaCastAccess::$lng
protected

Definition at line 25 of file class.ilObjMediaCastAccess.php.

Referenced by _checkAccess().

◆ $rbacsystem

ilRbacSystem ilObjMediaCastAccess::$rbacsystem
protected

Definition at line 26 of file class.ilObjMediaCastAccess.php.

Referenced by _checkAccess().

◆ $user

ilObjUser ilObjMediaCastAccess::$user
protected

Definition at line 24 of file class.ilObjMediaCastAccess.php.

Referenced by _checkAccess().


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