1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-23 18:48:37 +03:00

Permissions: Updated use of helpers to use enums

Also added middlware method to Permission enum to allow easier usage
with controller middleware.
This commit is contained in:
Dan Brown
2025-09-09 09:48:19 +01:00
parent 33a0237f87
commit 419dbadcfd
62 changed files with 165 additions and 145 deletions

View File

@@ -125,7 +125,7 @@ class UserApiController extends ApiController
{
$data = $this->validate($request, $this->rules($id)['update']);
$user = $this->userRepo->getById($id);
$this->userRepo->update($user, $data, userCan('users-manage'));
$this->userRepo->update($user, $data, userCan(\BookStack\Permissions\Permission::UsersManage));
$this->singleFormatter($user);
return response()->json($user);