ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjMediaPoolAccess 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 ilObjMediaPoolAccess:
+ Collaboration diagram for ilObjMediaPoolAccess:

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)
 check whether goto script will succeed 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

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

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

Definition at line 19 of file class.ilObjMediaPoolAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaPoolAccess::__construct ( )

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

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

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

Member Function Documentation

◆ _checkAccess()

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

Definition at line 68 of file class.ilObjMediaPoolAccess.php.

References $user_id, ILIAS\Repository\access(), ilAccessInfo\IL_NO_OBJECT_ACCESS, ILIAS\Repository\lng(), and ILIAS\Repository\user().

68  : bool
69  {
70  if (is_null($user_id)) {
71  $user_id = $this->user->getId();
72  }
73 
74  switch ($permission) {
75  case "read":
76  case "visible":
77  if (self::_isOffline($obj_id) &&
78  (!$this->rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id))) {
79  $this->access->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $this->lng->txt("offline"));
80  return false;
81  }
82  break;
83  }
84  return true;
85  }
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjMediaPoolAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Definition at line 53 of file class.ilObjMediaPoolAccess.php.

References $DIC.

53  : bool
54  {
55  global $DIC;
56 
57  $ilAccess = $DIC->access();
58 
59  $t_arr = explode("_", $target);
60 
61  if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
62  $ilAccess->checkAccess("visible", "", $t_arr[1])) {
63  return true;
64  }
65  return false;
66  }
global $DIC
Definition: shib_login.php:22

◆ _getCommands()

static ilObjMediaPoolAccess::_getCommands ( )
static

Definition at line 36 of file class.ilObjMediaPoolAccess.php.

Referenced by ilObjMediaPoolListGUI\init().

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

Field Documentation

◆ $access

ilAccessHandler ilObjMediaPoolAccess::$access
protected

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

◆ $lng

ilLanguage ilObjMediaPoolAccess::$lng
protected

Definition at line 23 of file class.ilObjMediaPoolAccess.php.

◆ $rbacsystem

ilRbacSystem ilObjMediaPoolAccess::$rbacsystem
protected

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

◆ $user

ilObjUser ilObjMediaPoolAccess::$user
protected

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


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