Definition at line 14 of file class.ilBadgeWAC.php.
◆ canBeDelivered()
ilBadgeWAC::canBeDelivered |
( |
ilWACPath |
$ilWACPath | ) |
|
- Parameters
-
- Returns
- bool
Implements ilWACCheckingClass.
Definition at line 16 of file class.ilBadgeWAC.php.
17 {
19
20 if (strpos($ilWACPath->
getPath(),
'..') !==
false) {
21 return false;
22 }
23
24 if (!preg_match(
'@ilBadge\/(\d+\/)*?badge(tmpl)?_(\d+)\/@ui', $ilWACPath->
getPath())) {
25 return false;
26 }
27
29 $admin_ref_id = null;
30 if ($obj_id > 0) {
32 }
33
34 $has_global_badge_administration_access = (
35 $admin_ref_id > 0 &&
36 $DIC->rbac()->system()->checkAccessOfUser(
$DIC->user()->getId(),
'read', $admin_ref_id)
37 );
38
39 if (preg_match(
'@\/badgetmpl_(\d+)\/@ui', $ilWACPath->
getPath())) {
40
41 return $has_global_badge_administration_access;
42 }
43
44 if (preg_match(
'@\/badge_(\d+)\/@ui', $ilWACPath->
getPath(), $matches)) {
45 if ($has_global_badge_administration_access) {
46 return true;
47 }
48
49 $badge_id = (int) $matches[1];
50
51 return (
55 );
56 }
57
58 return false;
59 }
isAssignedBadgeOfPublishedUserProfile(\ILIAS\DI\Container $DIC, int $badge_id)
hasAccessToBadgeParentIdNode(\ILIAS\DI\Container $DIC, int $badge_id, bool $has_global_badge_administration_access)
isAssignedBadge(\ILIAS\DI\Container $DIC, int $badge_id)
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
static _getAllReferences($a_id)
get all reference ids of object
References $DIC, ilObject\_getAllReferences(), ilObject\_getObjectsByType(), ilWACPath\getPath(), hasAccessToBadgeParentIdNode(), isAssignedBadge(), and isAssignedBadgeOfPublishedUserProfile().
◆ hasAccessToBadgeParentIdNode()
ilBadgeWAC::hasAccessToBadgeParentIdNode |
( |
\ILIAS\DI\Container |
$DIC, |
|
|
int |
$badge_id, |
|
|
bool |
$has_global_badge_administration_access |
|
) |
| |
|
private |
Definition at line 61 of file class.ilBadgeWAC.php.
65 : bool {
66
67 $badge =
new ilBadge($badge_id);
68 if ($badge->getParentId() > 0) {
69 return false;
70 }
71
73 if (!$badge_handler->isObjectActive((int) $badge->getParentId())) {
74 return false;
75 }
76
78 if (!($context_ref_id > 0)) {
79 return false;
80 }
81
82 $context_ref_id = (int) $context_ref_id;
84 $has_access = $has_global_badge_administration_access;
85 } else {
86 $has_access =
$DIC->access()->checkAccessOfUser(
87 $DIC->user()->getId(),
88 'write',
89 '',
90 $context_ref_id
91 );
92 }
93
94 return $has_access;
95 }
static getInstance()
Constructor.
Referenced by canBeDelivered().
◆ isAssignedBadge()
◆ isAssignedBadgeOfPublishedUserProfile()
ilBadgeWAC::isAssignedBadgeOfPublishedUserProfile |
( |
\ILIAS\DI\Container |
$DIC, |
|
|
int |
$badge_id |
|
) |
| |
|
private |
Definition at line 110 of file class.ilBadgeWAC.php.
110 : bool
111 {
112
114 foreach ($assignments as $assignment) {
115 if (!$assignment->getPosition()) {
116 continue;
117 }
118
121 continue;
122 }
123
124 $profile_visibility = $user->getPref('public_profile');
125 if ($profile_visibility ===
'g' || ($profile_visibility ===
'y' && !
$DIC->user()->isAnonymous())) {
126 return true;
127 }
128 }
129
130 return false;
131 }
static getInstancesByBadgeId($a_badge_id)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
References $DIC, ilObjectFactory\getInstanceByObjId(), and ilBadgeAssignment\getInstancesByBadgeId().
Referenced by canBeDelivered().
The documentation for this class was generated from the following file: