Closed YuanTian1991 closed 3 years ago
CRUD for "User Management" page needs to implemented
Indeed, we don't have an endpoint to delete users. I will create it.
I've almost finished it but now I'm starting to think why @priesgo may not have implemented that. He had implemented enable/disable user, perhaps, because we shouldn't delete users. However, I can see the scenario where the user DOES want to quit the service and WANT all his/her related data deleted. For the moment I considered only Admin to DELETE the user but I'd like to hear your opinions on this matter.
So I know that @IsmailM 's opinion on this is that users shoudl be disabled rather than deleted?
I think @dvarrazzo we can add an extra column to users table, for disabled true/false
Disabled users would not be able to login
@pontikos We already have this set:
phenopolis_db=> \d public.users
Table "public.users"
Column | Type | Collation | Nullable | Default
----------------+--------------------------+-----------+----------+---------
user | text | | not null |
argon_password | text | | |
enabled | boolean | | | false
registered_on | timestamp with time zone | | |
confirmed | boolean | | | false
confirmed_on | timestamp with time zone | | |
email | text | | |
full_name | text | | |
Indexes:
"users_pkey" PRIMARY KEY, btree ("user")
"users_email_key" UNIQUE CONSTRAINT, btree (email)
"users_user_key" UNIQUE CONSTRAINT, btree ("user")
Referenced by:
TABLE "user_pagetable_colname" CONSTRAINT "user_pagetable_colname_user_fkey" FOREIGN KEY ("user") REFERENCES users("user")
Triggers:
"public.users_audit_trg" AFTER INSERT OR DELETE OR UPDATE ON users FOR EACH ROW EXECUTE FUNCTION audit."public.users_fn"()
ok then that's easy right? delete user just sets enabled to false? @YuanTian1991 this makese sense right?
@alanwilter make sure only enabled users can log in
Yes, it is designed this way.
Though in theory, only Admin can add user, however, we still need a button to delete from user table. And delete the user-individual relationship table.