ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjBlogAccess 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 ilObjBlogAccess:
+ Collaboration diagram for ilObjBlogAccess:

Public Member Functions

 __construct ()
 
 canBeDelivered (ilWACPath $ilWACPath)
 
- 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 isCommentsExportPossible (int $blog_id)
 
- 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...
 

Protected Attributes

ilObjUser $user
 
ilAccessHandler $access
 

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 ilObjBlogAccess

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Constructor & Destructor Documentation

◆ __construct()

ilObjBlogAccess::__construct ( )

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

References $DIC, ILIAS\Repository\access(), and ILIAS\Repository\user().

29  {
30  global $DIC;
31 
32  $this->user = $DIC->user();
33  $this->access = $DIC->access();
34  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkGoto()

static ilObjBlogAccess::_checkGoto ( string  $target)
static

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

References $DIC, and ilSharedResourceGUI\hasAccess().

47  : bool
48  {
49  global $DIC;
50 
51  $ilAccess = $DIC->access();
52 
53  $t_arr = explode("_", $target);
54 
55  if (substr($target, -3) === "wsp") {
56  return ilSharedResourceGUI::hasAccess($t_arr[1]);
57  }
58 
59  if ($t_arr[0] !== "blog" || ((int) $t_arr[1]) <= 0) {
60  return false;
61  }
62 
63  // #12648
64  if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
65  $ilAccess->checkAccess("visible", "", $t_arr[1])) {
66  return true;
67  }
68  return false;
69  }
global $DIC
Definition: feed.php:28
static hasAccess(int $a_node_id, bool $a_is_portfolio=false)
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjBlogAccess::_getCommands ( )
static

Definition at line 36 of file class.ilObjBlogAccess.php.

Referenced by ilObjBlogListGUI\init().

36  : array
37  {
38  return array(
39  array("permission" => "read", "cmd" => "preview", "lang_var" => "show", "default" => true),
40  array("permission" => "write", "cmd" => "render", "lang_var" => "edit"),
41  array("permission" => "contribute", "cmd" => "render", "lang_var" => "edit"),
42  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings"),
43  array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
44  );
45  }
+ Here is the caller graph for this function:

◆ canBeDelivered()

ilObjBlogAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Implements ilWACCheckingClass.

Definition at line 71 of file class.ilObjBlogAccess.php.

References $access, $ilUser, $ref_id, $results, $user, ilObject\_getAllReferences(), ilWACPath\getPath(), and ILIAS\Repository\int().

71  : bool
72  {
74  $ilAccess = $this->access;
75  if (preg_match("/\\/blog_([\\d]*)\\//uim", $ilWACPath->getPath(), $results)) {
76  $obj_id = $results[1];
77  if ($obj_id == "") {
78  return false;
79  }
80 
81  // personal workspace
82  $tree = new ilWorkspaceTree(0);
83  $node_id = $tree->lookupNodeId((int) $obj_id);
84  if ($node_id) {
85  $access_handler = new ilWorkspaceAccessHandler($tree);
86  if ($access_handler->checkAccessOfUser($tree, $ilUser->getId(), "read", "view", $node_id, "blog")) {
87  return true;
88  }
89  }
90  // repository (RBAC)
91  else {
92  $ref_ids = ilObject::_getAllReferences((int) $obj_id);
93  foreach ($ref_ids as $ref_id) {
94  if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "view", $ref_id, "blog", (int) $obj_id)) {
95  return true;
96  }
97  }
98  }
99  }
100 
101  return false;
102  }
ilAccessHandler $access
static _getAllReferences(int $id)
get all reference ids for object ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
$results
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ isCommentsExportPossible()

static ilObjBlogAccess::isCommentsExportPossible ( int  $blog_id)
static

Definition at line 104 of file class.ilObjBlogAccess.php.

References $DIC, and ilPrivacySettings\getInstance().

Referenced by ilObjBlogGUI\executeCommand(), and ilObjBlogListGUI\insertCommand().

104  : bool
105  {
106  global $DIC;
107 
108  $setting = $DIC->settings();
109  $notes = $DIC->notes();
110  $privacy = ilPrivacySettings::getInstance();
111  if ($setting->get("disable_comments")) {
112  return false;
113  }
114  if (!$privacy->enabledCommentsExport()) {
115  return false;
116  }
117  if (!$notes->domain()->commentsActive($blog_id)) {
118  return false;
119  }
120  return true;
121  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjBlogAccess::$access
protected

Definition at line 26 of file class.ilObjBlogAccess.php.

Referenced by canBeDelivered().

◆ $user

ilObjUser ilObjBlogAccess::$user
protected

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

Referenced by canBeDelivered().


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