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