Repository navigation
|
Hello, we use SSO, and our admin is on holiday for several weeks, so how can we add an existing user to the admin/super-user role? I didn't find a command which can do that: any ideas? |
Replies: 1 comment
|
There's no artisan command that promotes an existing user. $u = App\Models\User::where('username', 'jane.doe')->firstOrFail();
$p = json_decode($u->permissions ?: '{}', true) ?: [];
$p['superuser'] = 1;
App\Models\User::whereKey($u->id)->update(['permissions' => json_encode($p)]);Use the username exactly as it appears in Snipe-IT (with SSO this is often the email address). Permissions are stored as a JSON string on the user, and If you'd rather do it from the UI, create a local admin with and log in at |
There's no artisan command that promotes an existing user.
snipeit:create-adminonly creates a new one. You can do it fromtinkerthough, from the same directory:Use the username exactly as it appears in Snipe-IT (with SSO this is often the email address). Permissions are stored as a JSON string on the user, and
superuserset to1is whatUser::isSuperUser()checks. This keeps the user's other permissions as they are. The query-levelupdate()skips …