ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjBlogAccess Class Reference

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

Constructor & Destructor Documentation

◆ __construct()

ilObjBlogAccess::__construct ( )

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

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

31  {
32  global $DIC;
33 
34  $this->user = $DIC->user();
35  $this->access = $DIC->access();
36  }
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 49 of file class.ilObjBlogAccess.php.

References $DIC, and ilSharedResourceGUI\hasAccess().

49  : bool
50  {
51  global $DIC;
52 
53  $ilAccess = $DIC->access();
54 
55  $t_arr = explode("_", $target);
56 
57  if (substr($target, -3) === "wsp") {
58  return ilSharedResourceGUI::hasAccess((int) $t_arr[1]);
59  }
60 
61  if ($t_arr[0] !== "blog" || ((int) $t_arr[1]) <= 0) {
62  return false;
63  }
64 
65  // #12648
66  if ($ilAccess->checkAccess("read", "", (int) $t_arr[1]) ||
67  $ilAccess->checkAccess("visible", "", (int) $t_arr[1])) {
68  return true;
69  }
70  return false;
71  }
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 38 of file class.ilObjBlogAccess.php.

Referenced by ilObjBlogListGUI\init().

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

◆ canBeDelivered()

ilObjBlogAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Implements ilWACCheckingClass.

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

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

73  : bool
74  {
75  $ilUser = $this->user;
76  $ilAccess = $this->access;
77  if (preg_match("/\\/blog_([\\d]*)\\//uim", $ilWACPath->getPath(), $results)) {
78  $obj_id = $results[1];
79  if ($obj_id == "") {
80  return false;
81  }
82 
83  // personal workspace
84  $tree = new ilWorkspaceTree(0);
85  $node_id = $tree->lookupNodeId((int) $obj_id);
86  if ($node_id) {
87  $access_handler = new ilWorkspaceAccessHandler($tree);
88  if ($access_handler->checkAccessOfUser($tree, $ilUser->getId(), "read", "view", $node_id, "blog")) {
89  return true;
90  }
91  }
92  // repository (RBAC)
93  else {
94  $ref_ids = ilObject::_getAllReferences((int) $obj_id);
95  foreach ($ref_ids as $ref_id) {
96  if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "view", $ref_id, "blog", (int) $obj_id)) {
97  return true;
98  }
99  }
100  }
101  }
102 
103  return false;
104  }
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
+ Here is the call graph for this function:

◆ isCommentsExportPossible()

static ilObjBlogAccess::isCommentsExportPossible ( int  $blog_id)
static

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

References $DIC, and ilPrivacySettings\getInstance().

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

106  : bool
107  {
108  global $DIC;
109 
110  $setting = $DIC->settings();
111  $notes = $DIC->notes();
112  $privacy = ilPrivacySettings::getInstance();
113  if ($setting->get("disable_comments")) {
114  return false;
115  }
116  if (!$privacy->enabledCommentsExport()) {
117  return false;
118  }
119  if (!$notes->domain()->commentsActive($blog_id)) {
120  return false;
121  }
122  return true;
123  }
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 28 of file class.ilObjBlogAccess.php.

Referenced by canBeDelivered().

◆ $user

ilObjUser ilObjBlogAccess::$user
protected

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

Referenced by canBeDelivered().


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