mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
ActionController: allow for fluent use of...
...assertOneOfPermissions
This commit is contained in:
parent
4db73fdb95
commit
4caf3fce51
@ -66,6 +66,7 @@ abstract class ActionController extends Controller implements ControlsAndContent
|
|||||||
*
|
*
|
||||||
* @param array $permissions Permission name list
|
* @param array $permissions Permission name list
|
||||||
*
|
*
|
||||||
|
* @return $this
|
||||||
* @throws SecurityException If the current user lacks the given permission
|
* @throws SecurityException If the current user lacks the given permission
|
||||||
*/
|
*/
|
||||||
protected function assertOneOfPermissions($permissions)
|
protected function assertOneOfPermissions($permissions)
|
||||||
@ -74,7 +75,7 @@ abstract class ActionController extends Controller implements ControlsAndContent
|
|||||||
|
|
||||||
foreach ($permissions as $permission) {
|
foreach ($permissions as $permission) {
|
||||||
if ($auth->hasPermission($permission)) {
|
if ($auth->hasPermission($permission)) {
|
||||||
return;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user