Skip to content

Backend - White List Model - User Manage User #124

@minhngo3818

Description

@minhngo3818

The admin and maintainer information will be displayed on the admin dashboard. In order to prevent an admin change information of another admin/maintainer freely. We need to add a white list to handle changes on one another. A change will be requested by an admin, and a second admin will verify that change. This feature only works with admin users. It does not apply to maintainers.

There are three reasons:
- A user somehow cannot log in but need another admin to change information (possibly email).
- A user won't be an admin/maintainer anymore that needs another admin to delete their account.
- Change role maintainer to admin, and vice versa

Model name: whitelist-user-change (on the database), WUserChange (in the codebase)
Fields:
- target_user: String ( reference of user _id)
- pair_approval: Array of reference user_id, limit length 2
- created_at Date Immutable
- data: {
first_name: { type: String },
last_name: { type : String },
email: { type: String, validate: email validation }
role: { type: String, enum: ["Admin", "Maintainer"] }
}

We will use mongoose and MongoDB for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions