ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 

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

Protected Attributes

 $user
 
 $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjBlogAccess::__construct ( )

Constructor.

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

References $DIC, and user().

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

Member Function Documentation

◆ _checkGoto()

static ilObjBlogAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

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

References $DIC, and ilSharedResourceGUI\hasAccess().

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)
$DIC
Definition: xapitoken.php:46
+ 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"), );

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

Referenced by ilObjBlogListGUI\init().

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  }
+ Here is the caller graph for this function:

◆ canBeDelivered()

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

Implements ilWACCheckingClass.

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

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

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  }
Access handler for personal workspace.
static _getAllReferences($a_id)
get all reference ids of object
Tree handler for personal workspace.
$ilUser
Definition: imgupload.php:18
$results
+ Here is the call 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: