ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ 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
{
29
static
function
_getCommands
()
30
{
31
$commands =
array
32
(
33
array
(
"permission"
=>
"read"
,
"cmd"
=>
"preview"
,
"lang_var"
=>
"show"
,
"default"
=>
true
),
34
array
(
"permission"
=>
"write"
,
"cmd"
=>
"render"
,
"lang_var"
=>
"edit"
),
35
array
(
"permission"
=>
"contribute"
,
"cmd"
=>
"render"
,
"lang_var"
=>
"edit"
),
36
array
(
"permission"
=>
"write"
,
"cmd"
=>
"edit"
,
"lang_var"
=>
"settings"
),
37
array
(
"permission"
=>
"write"
,
"cmd"
=>
"export"
,
"lang_var"
=>
"export_html"
)
38
);
39
40
return
$commands;
41
}
42
46
static
function
_checkGoto
($a_target)
47
{
48
global $ilAccess;
49
50
$t_arr = explode(
"_"
, $a_target);
51
52
if
(substr($a_target, -3) ==
"wsp"
)
53
{
54
include_once
"Services/PersonalWorkspace/classes/class.ilSharedResourceGUI.php"
;
55
return
ilSharedResourceGUI::hasAccess
($t_arr[1]);
56
}
57
58
if
($t_arr[0] !=
"blog"
|| ((
int
) $t_arr[1]) <= 0)
59
{
60
return
false
;
61
}
62
63
// #12648
64
if
($ilAccess->checkAccess(
"read"
,
""
, $t_arr[1]))
65
{
66
return
true
;
67
}
68
return
false
;
69
}
70
76
public
function
canBeDelivered
(
ilWACPath
$ilWACPath) {
77
global
$ilUser
, $ilAccess;
78
79
if
(preg_match(
"/\\/blog_([\\d]*)\\//uism"
, $ilWACPath->
getPath
(),
$results
))
80
{
81
$obj_id =
$results
[1];
82
83
// personal workspace
84
include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"
;
85
$tree =
new
ilWorkspaceTree
(0);
86
$node_id = $tree->lookupNodeId($obj_id);
87
if
($node_id)
88
{
89
include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"
;
90
$access_handler =
new
ilWorkspaceAccessHandler
($tree);
91
if
($access_handler->checkAccessOfUser($tree, $ilUser->getId(),
"read"
,
"view"
, $node_id,
"blog"
)) {
92
return
true
;
93
}
94
}
95
// repository (RBAC)
96
else
97
{
98
$ref_ids =
ilObject::_getAllReferences
($obj_id);
99
foreach
($ref_ids as
$ref_id
)
100
{
101
if
($ilAccess->checkAccessOfUser($ilUser->getId(),
"read"
,
"view"
,
$ref_id
,
"blog"
, $obj_id))
102
{
103
return
true
;
104
}
105
}
106
}
107
}
108
109
return
false
;
110
}
111
}
112
113
?>
ilObjBlogAccess
Class ilObjBlogAccess.
Definition:
class.ilObjBlogAccess.php:15
ilWorkspaceAccessHandler
Access handler for personal workspace.
Definition:
class.ilWorkspaceAccessHandler.php:17
ilObjBlogAccess\canBeDelivered
canBeDelivered(ilWACPath $ilWACPath)
Definition:
class.ilObjBlogAccess.php:76
ilWACPath
Class ilWACPath.
Definition:
class.ilWACPath.php:9
ilObject\_getAllReferences
static _getAllReferences($a_id)
get all reference ids of object
Definition:
class.ilObject.php:902
ilWorkspaceTree
Tree handler for personal workspace.
Definition:
class.ilWorkspaceTree.php:13
ilWACPath\getPath
getPath()
Definition:
class.ilWACPath.php:486
$ilUser
$ilUser
Definition:
imgupload.php:18
ilSharedResourceGUI\hasAccess
static hasAccess($a_node_id, $a_is_portfolio=false)
Definition:
class.ilSharedResourceGUI.php:154
$results
$results
Definition:
save_question_post_data.php:7
ilObjBlogAccess\_checkGoto
static _checkGoto($a_target)
check whether goto script will succeed
Definition:
class.ilObjBlogAccess.php:46
ilWACCheckingClass
Class ilWACCheckingClass.
Definition:
interface.ilWACCheckingClass.php:10
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilObjBlogAccess\_getCommands
static _getCommands()
get commands
Definition:
class.ilObjBlogAccess.php:29
$ref_id
$ref_id
Definition:
sahs_server.php:39
ilObjectAccess
Class ilObjectAccess.
Definition:
class.ilObjectAccess.php:16
php
Modules
Blog
classes
class.ilObjBlogAccess.php
Generated on Fri Feb 21 2025 19:00:57 for ILIAS by
1.8.13 (using
Doxyfile
)