@@ 131-144 (lines=14) @@ | ||
128 | ||
129 | $privileges = $this->getElementAttribute($element, 'Secured\Privilege'); |
|
130 | ||
131 | foreach ($resources as $resource) { |
|
132 | if ($privileges !== FALSE) { |
|
133 | foreach ($privileges as $privilege) { |
|
134 | if ($this->user->isAllowed($resource, $privilege)) { |
|
135 | return TRUE; |
|
136 | } |
|
137 | } |
|
138 | ||
139 | } else { |
|
140 | if ($this->user->isAllowed($resource)) { |
|
141 | return TRUE; |
|
142 | } |
|
143 | } |
|
144 | } |
|
145 | ||
146 | return FALSE; |
|
147 | } |
@@ 128-141 (lines=14) @@ | ||
125 | throw new Exceptions\InvalidStateException('Invalid resources count in \'resource\' parameter!'); |
|
126 | } |
|
127 | ||
128 | foreach ($resources as $resource) { |
|
129 | if (count($privileges)) { |
|
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 | } |