ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjBlogAccess Class Reference

Class ilObjBlogAccess. More...

+ Inheritance diagram for ilObjBlogAccess:
+ Collaboration diagram for ilObjBlogAccess:

Public Member Functions

 __construct ()
 Constructor. More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
- 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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static isCommentsExportPossible ($blog_id)
 Is comments export possible? 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...
 

Protected Attributes

 $user
 
 $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjBlogAccess::__construct ( )

Constructor.

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

27 {
28 global $DIC;
29
30 $this->user = $DIC->user();
31 $this->access = $DIC->access();
32 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkGoto()

static ilObjBlogAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

63 {
64 global $DIC;
65
66 $ilAccess = $DIC->access();
67
68 $t_arr = explode("_", $a_target);
69
70 if (substr($a_target, -3) == "wsp") {
71 return ilSharedResourceGUI::hasAccess($t_arr[1]);
72 }
73
74 if ($t_arr[0] != "blog" || ((int) $t_arr[1]) <= 0) {
75 return false;
76 }
77
78 // #12648
79 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
80 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
81 return true;
82 }
83 return false;
84 }
static hasAccess($a_node_id, $a_is_portfolio=false)

References $DIC, and ilSharedResourceGUI\hasAccess().

+ Here is the call graph for this function:

◆ _getCommands()

static ilObjBlogAccess::_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"), );

Reimplemented from ilObjectAccess.

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

47 {
48 $commands = array(
49 array("permission" => "read", "cmd" => "preview", "lang_var" => "show", "default" => true),
50 array("permission" => "write", "cmd" => "render", "lang_var" => "edit"),
51 array("permission" => "contribute", "cmd" => "render", "lang_var" => "edit"),
52 array("permission" => "write", "cmd" => "edit", "lang_var" => "settings"),
53 array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
54 );
55
56 return $commands;
57 }

Referenced by ilObjBlogListGUI\init().

+ Here is the caller graph for this function:

◆ canBeDelivered()

ilObjBlogAccess::canBeDelivered ( ilWACPath  $ilWACPath)
Parameters
ilWACPath$ilWACPath
Returns
bool

Reimplemented from ilObjectAccess.

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

92 {
94 $ilAccess = $this->access;
95
96 if (preg_match("/\\/blog_([\\d]*)\\//uism", $ilWACPath->getPath(), $results)) {
97 $obj_id = $results[1];
98
99 // personal workspace
100 $tree = new ilWorkspaceTree(0);
101 $node_id = $tree->lookupNodeId($obj_id);
102 if ($node_id) {
103 $access_handler = new ilWorkspaceAccessHandler($tree);
104 if ($access_handler->checkAccessOfUser($tree, $ilUser->getId(), "read", "view", $node_id, "blog")) {
105 return true;
106 }
107 }
108 // repository (RBAC)
109 else {
110 $ref_ids = ilObject::_getAllReferences($obj_id);
111 foreach ($ref_ids as $ref_id) {
112 if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "view", $ref_id, "blog", $obj_id)) {
113 return true;
114 }
115 }
116 }
117 }
118
119 return false;
120 }
static _getAllReferences($a_id)
get all reference ids of object
Access handler for personal workspace.
Tree handler for personal workspace.
$ilUser
Definition: imgupload.php:18
$results

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

+ Here is the call graph for this function:

◆ isCommentsExportPossible()

static ilObjBlogAccess::isCommentsExportPossible (   $blog_id)
static

Is comments export possible?

Parameters
int$blog_id
Returns
bool

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

129 {
130 global $DIC;
131
132 $setting = $DIC->settings();
134 if ($setting->get("disable_comments")) {
135 return false;
136 }
137 if (!$privacy->enabledCommentsExport()) {
138 return false;
139 }
140 if (!ilNote::commentsActivated($blog_id, 0, "blog")) {
141 return false;
142 }
143 return true;
144 }
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
static _getInstance()
Get instance of ilPrivacySettings.

References $DIC, ilPrivacySettings\_getInstance(), and ilNote\commentsActivated().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilObjBlogAccess::$access
protected

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

Referenced by canBeDelivered().

◆ $user

ilObjBlogAccess::$user
protected

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

Referenced by canBeDelivered().


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