ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 

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. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Protected Attributes

 $user
 
 $access
 

Detailed Description

Class ilObjBlogAccess.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilObjRootFolderAccess.php 15678 2008-01-06 20:40:55Z akill

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

Constructor & Destructor Documentation

◆ __construct()

ilObjBlogAccess::__construct ( )

Constructor.

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

References $DIC, and user().

32  {
33  global $DIC;
34 
35  $this->user = $DIC->user();
36  $this->access = $DIC->access();
37  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ 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 67 of file class.ilObjBlogAccess.php.

References $DIC, and ilSharedResourceGUI\hasAccess().

68  {
69  global $DIC;
70 
71  $ilAccess = $DIC->access();
72 
73  $t_arr = explode("_", $a_target);
74 
75  if (substr($a_target, -3) == "wsp") {
76  include_once "Services/PersonalWorkspace/classes/class.ilSharedResourceGUI.php";
77  return ilSharedResourceGUI::hasAccess($t_arr[1]);
78  }
79 
80  if ($t_arr[0] != "blog" || ((int) $t_arr[1]) <= 0) {
81  return false;
82  }
83 
84  // #12648
85  if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
86  return true;
87  }
88  return false;
89  }
global $DIC
Definition: saml.php:7
static hasAccess($a_node_id, $a_is_portfolio=false)
+ 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 51 of file class.ilObjBlogAccess.php.

References array.

Referenced by ilObjBlogListGUI\init().

52  {
53  $commands = array(
54  array("permission" => "read", "cmd" => "preview", "lang_var" => "show", "default" => true),
55  array("permission" => "write", "cmd" => "render", "lang_var" => "edit"),
56  array("permission" => "contribute", "cmd" => "render", "lang_var" => "edit"),
57  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings"),
58  array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
59  );
60 
61  return $commands;
62  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ canBeDelivered()

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

Implements ilWACCheckingClass.

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

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

97  {
99  $ilAccess = $this->access;
100 
101  if (preg_match("/\\/blog_([\\d]*)\\//uism", $ilWACPath->getPath(), $results)) {
102  $obj_id = $results[1];
103 
104  // personal workspace
105  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
106  $tree = new ilWorkspaceTree(0);
107  $node_id = $tree->lookupNodeId($obj_id);
108  if ($node_id) {
109  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
110  $access_handler = new ilWorkspaceAccessHandler($tree);
111  if ($access_handler->checkAccessOfUser($tree, $ilUser->getId(), "read", "view", $node_id, "blog")) {
112  return true;
113  }
114  }
115  // repository (RBAC)
116  else {
117  $ref_ids = ilObject::_getAllReferences($obj_id);
118  foreach ($ref_ids as $ref_id) {
119  if ($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "view", $ref_id, "blog", $obj_id)) {
120  return true;
121  }
122  }
123  }
124  }
125 
126  return false;
127  }
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
Definition: svg-scanner.php:47
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilObjBlogAccess::$access
protected

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

Referenced by canBeDelivered().

◆ $user

ilObjBlogAccess::$user
protected

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

Referenced by canBeDelivered().


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