]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/PermissionController.php
Updated ldap so extension not required in testing
[bookstack] / app / Http / Controllers / PermissionController.php
index 3f2eb7f9995271f3e062ff05baa4901815f137e2..ed430c0b7194e09717e3b4d9aeb06f14aad4ad9d 100644 (file)
@@ -2,7 +2,7 @@
 
 use BookStack\Exceptions\PermissionsException;
 use BookStack\Repos\PermissionsRepo;
-use BookStack\Services\RestrictionService;
+use BookStack\Services\PermissionService;
 use Illuminate\Http\Request;
 use BookStack\Http\Requests;
 
@@ -63,11 +63,13 @@ class PermissionController extends Controller
      * Show the form for editing a user role.
      * @param $id
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     * @throws PermissionsException
      */
     public function editRole($id)
     {
         $this->checkPermission('user-roles-manage');
         $role = $this->permissionsRepo->getRoleById($id);
+        if ($role->hidden) throw new PermissionsException('This role cannot be edited');
         return view('settings/roles/edit', ['role' => $role]);
     }