mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Roles user add fix (#15257)
* Fix user add command doesn't allow roles * update baseline
This commit is contained in:
parent
744ff7543e
commit
c737788727
@ -27,10 +27,10 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Console\LnmsCommand;
|
||||
use App\Models\User;
|
||||
use Bouncer;
|
||||
use Illuminate\Validation\Rule;
|
||||
use LibreNMS\Authentication\LegacyAuth;
|
||||
use LibreNMS\Config;
|
||||
use Silber\Bouncer\Database\Role;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
@ -68,12 +68,12 @@ class AddUserCommand extends LnmsCommand
|
||||
$this->warn(__('commands.user:add.wrong-auth'));
|
||||
}
|
||||
|
||||
$roles = Role::pluck('name');
|
||||
$roles = Bouncer::role()->pluck('name');
|
||||
|
||||
$this->validate([
|
||||
'username' => ['required', Rule::unique('users', 'username')->where('auth_type', 'mysql')],
|
||||
'email' => 'nullable|email',
|
||||
'role' => Rule::in($roles->keys()),
|
||||
'role.*' => Rule::in($roles),
|
||||
]);
|
||||
|
||||
// set get password
|
||||
|
@ -170,6 +170,11 @@ parameters:
|
||||
count: 1
|
||||
path: LibreNMS/Util/Snmpsim.php
|
||||
|
||||
-
|
||||
message: "#^Static method Silber\\\\Bouncer\\\\BouncerFacade\\:\\:role\\(\\) invoked with 0 parameters, 1 required\\.$#"
|
||||
count: 1
|
||||
path: app/Console/Commands/AddUserCommand.php
|
||||
|
||||
-
|
||||
message: "#^Property App\\\\Console\\\\Commands\\\\InternalHttpRequest\\:\\:\\$app is never read, only written\\.$#"
|
||||
count: 1
|
||||
|
Loading…
Reference in New Issue
Block a user