ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjFolderAccess Class Reference

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

Class ilObjFileAccess.

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

Definition at line 26 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 38 of file class.ilObjFolderAccess.php.

38 : bool
39 {
40 if ($cmd === "download" &&
41 !self::hasDownloadAction($ref_id)) {
42 return false;
43 }
44 return true;
45 }
$ref_id
Definition: ltiauth.php:66

References $ref_id.

◆ _checkGoto()

static ilObjFolderAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

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

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 47 of file class.ilObjFolderAccess.php.

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

References ilDAVActivationChecker\_isActive().

+ Here is the call graph for this function:

◆ getFolderSettings()

static ilObjFolderAccess::getFolderSettings ( )
staticprivate

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

30 : ilSetting
31 {
32 if (is_null(self::$folderSettings)) {
33 self::$folderSettings = new ilSetting('fold');
34 }
36 }
static ilSetting $folderSettings
ILIAS Setting Class.

References $folderSettings.

Referenced by hasDownloadAction().

+ Here is the caller graph for this function:

◆ hasDownloadAction()

static ilObjFolderAccess::hasDownloadAction ( int  $ref_id)
staticprivate

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

68 : bool
69 {
70 $settings = self::getFolderSettings();
71 if ((int) $settings->get("enable_download_folder", '0') !== 1) {
72 return false;
73 }
74 return true;
75 }

References getFolderSettings().

+ Here is the call graph for this function:

Field Documentation

◆ $folderSettings

ilSetting ilObjFolderAccess::$folderSettings = null
staticprivate

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

Referenced by getFolderSettings().


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