ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjFolderAccess Class Reference

Class ilObjFileAccess. More...

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

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed 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 if object type does not support centralized offline handling. 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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
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

◆ _checkGoto()

static ilObjFolderAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

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

References $DIC.

104  {
105  global $DIC;
106 
107  $ilAccess = $DIC->access();
108 
109  $t_arr = explode("_", $a_target);
110 
111  if ($t_arr[0] != "fold" || ((int) $t_arr[1]) <= 0) {
112  return false;
113  }
114 
115  if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
116  $ilAccess->checkAccess("visible", "", $t_arr[1])) {
117  return true;
118  }
119  return false;
120  }
global $DIC
Definition: goto.php:24

◆ _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(), ilWebDAVUtil\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  // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
46  // this is not consistent, with all other objects...
47  //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
49  $commands[] = array("permission" => "read", "cmd" => "download", "lang_var" => "download"); // #18805
50  }
51  // BEGIN WebDAV: Mount Webfolder.
52  include_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
54  include_once './Services/WebDAV/classes/class.ilWebDAVUtil.php';
55  if (ilWebDAVUtil::getInstance()->isLocalPasswordInstructionRequired()) {
56  $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
57  } else {
58  $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
59  }
60  }
61  $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
62  $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
63 
64  return $commands;
65  }
static hasDownloadAction($ref_id)
$_GET["client_id"]
static _isActive()
Static getter.
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 68 of file class.ilObjFolderAccess.php.

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

Referenced by _getCommands().

69  {
70  global $DIC;
71 
72  $tree = $DIC->repositoryTree();
73  $ilUser = $DIC->user();
75  // default value should reflect previous behaviour (-> 0)
76  if ($settings->get("enable_download_folder", 0) != 1) {
77  return false;
78  }
79 
80  /*
81  * deactivated check for now, because wrong ref_id here!
82 
83  *
84  $children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
85 
86  // no children at all, so no download button
87  if (count ($children) == 0)
88  return false;
89  // check if at least one of the children has a read permission
90  foreach ($children as $child)
91  {
92  if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
93  return true;
94  }
95  return false;
96  */
97  return true;
98  }
global $DIC
Definition: goto.php:24
$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: