ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjFolderAccess Class Reference

Class ilObjFileAccess. More...

+ Inheritance diagram for ilObjFolderAccess:
+ Collaboration diagram for ilObjFolderAccess:

Static Public Member Functions

static _getCommands ()
 get commands More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Static Private Member Functions

static getFolderSettings ()
 
static hasDownloadAction ($ref_id)
 

Static Private Attributes

static $folderSettings
 

Additional Inherited Members

- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 

Detailed Description

Class ilObjFileAccess.

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

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

Member Function Documentation

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

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

References $_GET, ilDAVActivationChecker\_isActive(), array, ilFMSettings\getInstance(), ilDAVUtils\getInstance(), and hasDownloadAction().

Referenced by ilObjFolderListGUI\init().

41  {
42  $commands = array();
43  $commands[] = array("permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true);
44 
45  include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
46  if (ilFMSettings::getInstance()->isEnabled()) {
47  $commands[] = array(
48  'permission' => 'read',
49  'cmd' => 'fileManagerLaunch',
50  'lang_var' => 'fm_start',
51  'enable_anonymous' => false
52  );
53  }
54 
55  // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
56  // this is not consistent, with all other objects...
57  //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
59  $commands[] = array("permission" => "read", "cmd" => "downloadFolder", "lang_var" => "download"); // #18805
60  }
61  // BEGIN WebDAV: Mount Webfolder.
62  include_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
64  include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
65  if (ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired()) {
66  $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
67  } else {
68  $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
69  }
70  }
71  $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
72  $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
73 
74  return $commands;
75  }
static hasDownloadAction($ref_id)
$_GET["client_id"]
static _isActive()
Static getter.
Create styles array
The data for the language used.
static getInstance()
Get singleton instance.
static getInstance()
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFolderSettings()

static ilObjFolderAccess::getFolderSettings ( )
staticprivate

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

References $folderSettings.

Referenced by hasDownloadAction().

+ Here is the caller graph for this function:

◆ hasDownloadAction()

static ilObjFolderAccess::hasDownloadAction (   $ref_id)
staticprivate

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

References $DIC, $ilUser, and getFolderSettings().

Referenced by _getCommands().

79  {
80  global $DIC;
81 
82  $tree = $DIC->repositoryTree();
83  $ilUser = $DIC->user();
85  // default value should reflect previous behaviour (-> 0)
86  if ($settings->get("enable_download_folder", 0) != 1) {
87  return false;
88  }
89 
90  /*
91  * deactivated check for now, because wrong ref_id here!
92 
93  *
94  $children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
95 
96  // no children at all, so no download button
97  if (count ($children) == 0)
98  return false;
99  // check if at least one of the children has a read permission
100  foreach ($children as $child)
101  {
102  if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
103  return true;
104  }
105  return false;
106  */
107  return true;
108  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $folderSettings

ilObjFolderAccess::$folderSettings
staticprivate

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

Referenced by getFolderSettings().


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