X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/295cd0160525125bbd7756d7ad07392ae7201cb8..refs/pull/5689/head:/app/Users/Controllers/RoleController.php diff --git a/app/Users/Controllers/RoleController.php b/app/Users/Controllers/RoleController.php index c383df39b..0a7fdcc9b 100644 --- a/app/Users/Controllers/RoleController.php +++ b/app/Users/Controllers/RoleController.php @@ -3,7 +3,7 @@ namespace BookStack\Users\Controllers; use BookStack\Exceptions\PermissionsException; -use BookStack\Http\Controllers\Controller; +use BookStack\Http\Controller; use BookStack\Permissions\PermissionsRepo; use BookStack\Users\Models\Role; use BookStack\Users\Queries\RolesAllPaginatedAndSorted; @@ -13,11 +13,9 @@ use Illuminate\Http\Request; class RoleController extends Controller { - protected PermissionsRepo $permissionsRepo; - - public function __construct(PermissionsRepo $permissionsRepo) - { - $this->permissionsRepo = $permissionsRepo; + public function __construct( + protected PermissionsRepo $permissionsRepo + ) { } /** @@ -77,7 +75,7 @@ class RoleController extends Controller $data = $this->validate($request, [ 'display_name' => ['required', 'min:3', 'max:180'], 'description' => ['max:180'], - 'external_auth_id' => ['string'], + 'external_auth_id' => ['string', 'max:180'], 'permissions' => ['array'], 'mfa_enforced' => ['string'], ]); @@ -111,7 +109,7 @@ class RoleController extends Controller $data = $this->validate($request, [ 'display_name' => ['required', 'min:3', 'max:180'], 'description' => ['max:180'], - 'external_auth_id' => ['string'], + 'external_auth_id' => ['string', 'max:180'], 'permissions' => ['array'], 'mfa_enforced' => ['string'], ]); @@ -156,7 +154,7 @@ class RoleController extends Controller } catch (PermissionsException $e) { $this->showErrorNotification($e->getMessage()); - return redirect()->back(); + return redirect("/settings/roles/delete/{$id}"); } return redirect('/settings/roles');