ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- 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)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
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.

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:26

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

+ 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 
)

Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Reimplemented from ilObjectAccess.

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

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:66

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

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjMediaPoolAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

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 }

References $DIC.

◆ _getCommands()

static ilObjMediaPoolAccess::_getCommands ( )
static

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"), );

Returns
array{permission?:string, cmd?:string, lang_var?:string, default?:bool}[]

Reimplemented from ilObjectAccess.

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

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 }

Referenced by ilObjMediaPoolListGUI\init().

+ 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: