ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
- 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 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 
)

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

◆ _checkGoto()

static ilObjFolderAccess::_checkGoto ( string  $target)
static

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

References $DIC.

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

◆ _getCommands()

static ilObjFolderAccess::_getCommands ( )
static

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

References ilDAVActivationChecker\_isActive().

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  }
+ 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  }
35  return self::$folderSettings;
36  }

◆ 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  }

Field Documentation

◆ $folderSettings

ilSetting ilObjFolderAccess::$folderSettings = null
staticprivate

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


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