ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilObjBlogAccess.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once(
"./Services/Object/classes/class.ilObjectAccess.php"
);
6
require_once(
'./Services/WebAccessChecker/interfaces/interface.ilWACCheckingClass.php'
);
7
15
class
ilObjBlogAccess
extends
ilObjectAccess
implements
ilWACCheckingClass
16
{
20
protected
$user
;
21
25
protected
$access
;
26
27
31
public
function
__construct
()
32
{
33
global
$DIC
;
34
35
$this->
user
= $DIC->user();
36
$this->access = $DIC->access();
37
}
38
51
public
static
function
_getCommands
()
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
}
63
67
public
static
function
_checkGoto
($a_target)
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
}
90
96
public
function
canBeDelivered
(
ilWACPath
$ilWACPath)
97
{
98
$ilUser
=
$this->user
;
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
}
128
}
ilObjBlogAccess
Class ilObjBlogAccess.
Definition:
class.ilObjBlogAccess.php:15
$DIC
global $DIC
Definition:
saml.php:7
ilWorkspaceAccessHandler
Access handler for personal workspace.
Definition:
class.ilWorkspaceAccessHandler.php:17
ilObjBlogAccess\canBeDelivered
canBeDelivered(ilWACPath $ilWACPath)
Definition:
class.ilObjBlogAccess.php:96
ilWACPath
Class ilWACPath.
Definition:
class.ilWACPath.php:10
user
user()
Definition:
user.php:4
ilObject\_getAllReferences
static _getAllReferences($a_id)
get all reference ids of object
Definition:
class.ilObject.php:910
ilWorkspaceTree
Tree handler for personal workspace.
Definition:
class.ilWorkspaceTree.php:13
ilObjBlogAccess\$access
$access
Definition:
class.ilObjBlogAccess.php:25
ilWACPath\getPath
getPath()
Definition:
class.ilWACPath.php:547
ilObjBlogAccess\$user
$user
Definition:
class.ilObjBlogAccess.php:20
$ilUser
$ilUser
Definition:
imgupload.php:18
ilSharedResourceGUI\hasAccess
static hasAccess($a_node_id, $a_is_portfolio=false)
Definition:
class.ilSharedResourceGUI.php:203
ilObjBlogAccess\_checkGoto
static _checkGoto($a_target)
check whether goto script will succeed
Definition:
class.ilObjBlogAccess.php:67
ilWACCheckingClass
Class ilWACCheckingClass.
Definition:
interface.ilWACCheckingClass.php:12
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilObjBlogAccess\_getCommands
static _getCommands()
get commands
Definition:
class.ilObjBlogAccess.php:51
ilObjectAccess
Class ilObjectAccess.
Definition:
class.ilObjectAccess.php:16
$results
$results
Definition:
svg-scanner.php:47
ilObjBlogAccess\__construct
__construct()
Constructor.
Definition:
class.ilObjBlogAccess.php:31
Modules
Blog
classes
class.ilObjBlogAccess.php
Generated on Sat Jan 18 2025 19:01:13 for ILIAS by
1.8.13 (using
Doxyfile
)