]> BookStack Code Mirror - bookstack/blobdiff - app/Users/Controllers/UserSearchController.php
Permissions: Cleanup after review of enum implementation PR
[bookstack] / app / Users / Controllers / UserSearchController.php
index b6f37bce08b1f3daea32e13a3ba45b634a50f34f..a2543b7eed32723d5f8052d9f0365c46cdd6efc9 100644 (file)
@@ -3,6 +3,7 @@
 namespace BookStack\Users\Controllers;
 
 use BookStack\Http\Controller;
+use BookStack\Permissions\Permission;
 use BookStack\Users\Models\User;
 use Illuminate\Http\Request;
 
@@ -15,9 +16,9 @@ class UserSearchController extends Controller
     public function forSelect(Request $request)
     {
         $hasPermission = !user()->isGuest() && (
-            userCan('users-manage')
-                || userCan('restrictions-manage-own')
-                || userCan('restrictions-manage-all')
+            userCan(Permission::UsersManage)
+                || userCan(Permission::RestrictionsManageOwn)
+                || userCan(Permission::RestrictionsManageAll)
         );
 
         if (!$hasPermission) {