src/IPub/Permissions/Access/AnnotationChecker.php 1 location
|
@@ 128-141 (lines=14) @@
|
125 |
|
|
126 |
|
$privileges = UI\ComponentReflection::parseAnnotation($element, 'Secured\Privilege'); |
127 |
|
|
128 |
|
foreach ($resources as $resource) { |
129 |
|
if ($privileges !== FALSE) { |
130 |
|
foreach ($privileges as $privilege) { |
131 |
|
if ($this->user->isAllowed($resource, $privilege)) { |
132 |
|
return TRUE; |
133 |
|
} |
134 |
|
} |
135 |
|
|
136 |
|
} else { |
137 |
|
if ($this->user->isAllowed($resource)) { |
138 |
|
return TRUE; |
139 |
|
} |
140 |
|
} |
141 |
|
} |
142 |
|
|
143 |
|
return FALSE; |
144 |
|
} |
src/IPub/Permissions/Access/LatteChecker.php 1 location
|
@@ 125-138 (lines=14) @@
|
122 |
|
throw new Exceptions\InvalidStateException('Invalid resources count in \'resource\' parameter!'); |
123 |
|
} |
124 |
|
|
125 |
|
foreach ($resources as $resource) { |
126 |
|
if (count($privileges)) { |
127 |
|
foreach ($privileges as $privilege) { |
128 |
|
if ($this->user->isAllowed($resource, $privilege)) { |
129 |
|
return TRUE; |
130 |
|
} |
131 |
|
} |
132 |
|
|
133 |
|
} else { |
134 |
|
if ($this->user->isAllowed($resource)) { |
135 |
|
return TRUE; |
136 |
|
} |
137 |
|
} |
138 |
|
} |
139 |
|
|
140 |
|
return FALSE; |
141 |
|
} |