From 95782fffe2610b1451772c84cef87b651bc140f0 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 25 Sep 2023 01:52:45 +0800 Subject: [PATCH] fix install create administrator --- app/Repositories/UserRepository.php | 8 +++++--- include/constants.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 28ebbf605..791a4d17b 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -105,9 +105,11 @@ public function store(array $params) } if (!empty($params['class'])) { $class =intval($params['class']); - $authUser = Auth::user(); - if ($authUser && $class >= $authUser->class) { - throw new InsufficientPermissionException('No permission'); + if (!IN_NEXUS) { + $authUser = Auth::user(); + if ($authUser && $class >= $authUser->class) { + throw new InsufficientPermissionException('No permission'); + } } } else { $class = User::CLASS_USER; diff --git a/include/constants.php b/include/constants.php index 3d08f97a0..b603f0b74 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@