CrisisCleanup / crisiscleanup-2

[OLD] This version of the codebase was retired on March 27, 2020. Open Source Collaborative Disaster Recovery and Cleanup
https://www.crisiscleanup.org
Other
42 stars 24 forks source link

User Deactivate #387

Closed arroyoDev closed 6 years ago

arroyoDev commented 7 years ago

The system currently has no way to de-activate a user. We need to have that setting that prevents access and hides them form lists everywhere.

astashov commented 7 years ago

I'll try to take this

astashov commented 7 years ago

Approach: we could add is_disabled boolean field to users db, false by default. Then, we add a default_scope, which is is_active: false to User model. It's usually an antipattern, but in this case since we'll have to use it like in 90% of cases, should be okay.

Then, we'll exclude that default scope in /admin/users, and add a field - checkbox is_disabled to the edit user form.

What do you think?

tsanders commented 7 years ago

Yes, that should definitely work.