use BookStack\Exceptions\UserUpdateException;
use BookStack\Http\ApiController;
+use BookStack\Permissions\Permission;
use BookStack\Users\Models\User;
use BookStack\Users\UserRepo;
-use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\Rules\Password;
// Checks for all endpoints in this controller
$this->middleware(function ($request, $next) {
- $this->checkPermission('users-manage');
+ $this->checkPermission(Permission::UsersManage);
$this->preventAccessInDemoMode();
return $next($request);
{
$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(Permission::UsersManage));
$this->singleFormatter($user);
return response()->json($user);