]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/PermissionController.php
Use joint_permissions to determine is a user has an available page or chapter to...
[bookstack] / app / Http / Controllers / PermissionController.php
index cd064e7e80675e47188d0b02644926f94cfb8769..9be343c9a76011a5bd5b7a872ad78b1e6a9a8d3c 100644 (file)
@@ -1,7 +1,7 @@
 <?php namespace BookStack\Http\Controllers;
 
+use BookStack\Auth\Permissions\PermissionsRepo;
 use BookStack\Exceptions\PermissionsException;
-use BookStack\Repos\PermissionsRepo;
 use Illuminate\Http\Request;
 
 class PermissionController extends Controller
@@ -11,7 +11,7 @@ class PermissionController extends Controller
 
     /**
      * PermissionController constructor.
-     * @param PermissionsRepo $permissionsRepo
+     * @param \BookStack\Auth\Permissions\PermissionsRepo $permissionsRepo
      */
     public function __construct(PermissionsRepo $permissionsRepo)
     {
@@ -67,7 +67,9 @@ class PermissionController extends Controller
     {
         $this->checkPermission('user-roles-manage');
         $role = $this->permissionsRepo->getRoleById($id);
-        if ($role->hidden) throw new PermissionsException(trans('errors.role_cannot_be_edited'));
+        if ($role->hidden) {
+            throw new PermissionsException(trans('errors.role_cannot_be_edited'));
+        }
         return view('settings/roles/edit', ['role' => $role]);
     }
 
@@ -76,6 +78,7 @@ class PermissionController extends Controller
      * @param $id
      * @param Request $request
      * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+     * @throws PermissionsException
      */
     public function updateRole($id, Request $request)
     {