ILIAS  release_8 Revision v8.24
ilObjFolderAccess 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 ilObjFolderAccess:
+ Collaboration diagram for ilObjFolderAccess:

Public Member Functions

 _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...
 

Static Private Member Functions

static getFolderSettings ()
 
static hasDownloadAction (int $ref_id)
 

Static Private Attributes

static ilSetting $folderSettings = null
 

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 Class ilObjFileAccess

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ _checkAccess()

ilObjFolderAccess::_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 35 of file class.ilObjFolderAccess.php.

35 : bool
36 {
37 if ($cmd === "download" &&
38 !self::hasDownloadAction($ref_id)) {
39 return false;
40 }
41 return true;
42 }
$ref_id
Definition: ltiauth.php:67

References $ref_id.

◆ _checkGoto()

static ilObjFolderAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 74 of file class.ilObjFolderAccess.php.

74 : bool
75 {
76 global $DIC;
77
78 $ilAccess = $DIC->access();
79
80 $t_arr = explode("_", $target);
81
82 if ($t_arr[0] !== "fold" || ((int) $t_arr[1]) <= 0) {
83 return false;
84 }
85
86 if ($ilAccess->checkAccess("read", "", (int) $t_arr[1]) ||
87 $ilAccess->checkAccess("visible", "", (int) $t_arr[1])) {
88 return true;
89 }
90 return false;
91 }
global $DIC
Definition: feed.php:28

References $DIC.

◆ _getCommands()

static ilObjFolderAccess::_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 44 of file class.ilObjFolderAccess.php.

44 : array
45 {
46 $commands = [];
47 $commands[] = ["permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true];
48
49 // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
50 // this is not consistent, with all other objects...
51 //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
52 $commands[] = ["permission" => "read", "cmd" => "download", "lang_var" => "download"]; // #18805
53 // BEGIN WebDAV: Mount Webfolder.
55 $webdav_obj = new ilObjWebDAV();
56 $commands[] = $webdav_obj->retrieveWebDAVCommandArrayForActionMenu();
57 }
58 $commands[] = ["permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content"];
59 $commands[] = ["permission" => "write", "cmd" => "edit", "lang_var" => "settings"];
60
61 return $commands;
62 }

References ilDAVActivationChecker\_isActive().

+ Here is the call graph for this function:

◆ getFolderSettings()

static ilObjFolderAccess::getFolderSettings ( )
staticprivate

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

27 : ilSetting
28 {
29 if (is_null(self::$folderSettings)) {
30 self::$folderSettings = new ilSetting('fold');
31 }
33 }
static ilSetting $folderSettings
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $folderSettings.

Referenced by hasDownloadAction().

+ Here is the caller graph for this function:

◆ hasDownloadAction()

static ilObjFolderAccess::hasDownloadAction ( int  $ref_id)
staticprivate

Definition at line 65 of file class.ilObjFolderAccess.php.

65 : bool
66 {
68 if ((int) $settings->get("enable_download_folder", '0') !== 1) {
69 return false;
70 }
71 return true;
72 }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References ILIAS\LTI\ToolProvider\$settings, and getFolderSettings().

+ Here is the call graph for this function:

Field Documentation

◆ $folderSettings

ilSetting ilObjFolderAccess::$folderSettings = null
staticprivate

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

Referenced by getFolderSettings().


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