nafiesl / silsilah

A genealogy/family tree application, built with Laravel.
MIT License
588 stars 284 forks source link

[PROPOSAL] Admin for Managing All Users #49

Closed nafiesl closed 4 years ago

nafiesl commented 4 years ago

On current condition, user's data can only be modified by their managers (the one whom user ID stored on users.manager_id column). So we want to create a feature which allow us to set some users to be an admin.

Here is a possible solution without changing any DB structure:

  1. We have a env var and config to store array of user emails
  2. We take the user emails on the config to determine the system's admin.
  3. Config key: config('app.system_admins');
  4. Config value data type: array (of email addresses).

For example:

  1. We have User A, user B and User C
  2. User A is manager of User B, but not User C
  3. User A can edit User B data, but cannot edit user C data.
  4. We add user A email address on the app.system_admins config
  5. User A now can edit all user's data the system (not only User B).

This feature resolves this problem: Any user can be assigned as system admin to edit any user's data.