ActionController: allow for fluent use of...

...assertOneOfPermissions
This commit is contained in:
Thomas Gelf 2017-10-07 17:25:18 +02:00
parent 4db73fdb95
commit 4caf3fce51

View File

@ -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;
} }
} }