Open milkice233 opened 2 years ago
The command admin:create-user should allow the user to specify the role of the newly created user. But it failed to show the role menu. The issue may originate from this line https://github.com/z-song/laravel-admin/blob/301d46dc1bd8d7a7da964f223f7b6f982ea51a1b/src/Console/CreateUserCommand.php#L43 and the bug may be introduced in the commit https://github.com/z-song/laravel-admin/commit/c4ad42e8753ef5642c94a79ca9259829041e6786
laravel-admin 提供了一个 admin:create-user 功能方便用 php artisan 创建 laravel-admin 用户,原先的版本中在输入新创建用户的用户名和密码后,会提示用户选择角色,但最近发现现在的 laravel-admin 将不会提示用户选择角色,而是将所有角色都赋予给该用户。看了下源码,可能是 https://github.com/z-song/laravel-admin/blob/301d46dc1bd8d7a7da964f223f7b6f982ea51a1b/src/Console/CreateUserCommand.php#L43 这行出现的问题,应该是 if (!empty($selectedRoles)) ,在 https://github.com/z-song/laravel-admin/commit/c4ad42e8753ef5642c94a79ca9259829041e6786 这个 commit 中引入了该 bug
if (!empty($selectedRoles))
Run php artisan admin:create-user
After entering the new username & password, the CLI shows that the user has been successfully created, instead of showing the role menu.
运行 php artisan admin:create-user
输入完用户名和密码之后,直接提示创建成功,而不是要求用户选择角色。此时去管理后台看新创建的用户,发现该用户拥有所有角色。
Description:
The command admin:create-user should allow the user to specify the role of the newly created user. But it failed to show the role menu. The issue may originate from this line https://github.com/z-song/laravel-admin/blob/301d46dc1bd8d7a7da964f223f7b6f982ea51a1b/src/Console/CreateUserCommand.php#L43 and the bug may be introduced in the commit https://github.com/z-song/laravel-admin/commit/c4ad42e8753ef5642c94a79ca9259829041e6786
laravel-admin 提供了一个 admin:create-user 功能方便用 php artisan 创建 laravel-admin 用户,原先的版本中在输入新创建用户的用户名和密码后,会提示用户选择角色,但最近发现现在的 laravel-admin 将不会提示用户选择角色,而是将所有角色都赋予给该用户。看了下源码,可能是 https://github.com/z-song/laravel-admin/blob/301d46dc1bd8d7a7da964f223f7b6f982ea51a1b/src/Console/CreateUserCommand.php#L43 这行出现的问题,应该是
if (!empty($selectedRoles))
,在 https://github.com/z-song/laravel-admin/commit/c4ad42e8753ef5642c94a79ca9259829041e6786 这个 commit 中引入了该 bugSteps To Reproduce:
Run php artisan admin:create-user
After entering the new username & password, the CLI shows that the user has been successfully created, instead of showing the role menu.
运行 php artisan admin:create-user
输入完用户名和密码之后,直接提示创建成功,而不是要求用户选择角色。此时去管理后台看新创建的用户,发现该用户拥有所有角色。