Fix RBAC, user creation and update components
This commit is contained in:
@@ -24,11 +24,12 @@ declare
|
||||
v_user_id uuid;
|
||||
v_shop_id uuid;
|
||||
begin
|
||||
insert into auth.users(email, password_hash, full_name, is_active)
|
||||
values ('${EM}', crypt('${PW}', gen_salt('bf', 10)), '${NM}', true)
|
||||
insert into auth.users(email, password_hash, full_name, is_system_admin, is_active)
|
||||
values ('${EM}', crypt('${PW}', gen_salt('bf', 10)), '${NM}', true, true)
|
||||
on conflict (email) do update
|
||||
set password_hash = excluded.password_hash,
|
||||
full_name = excluded.full_name,
|
||||
is_system_admin = true,
|
||||
is_active = true
|
||||
returning id into v_user_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user