Admin
- Email:
admin@mail.com
- Password:
admin
- Permissions: Can read, write, and delete.
Viewer
- Email:
viewer@mail.com
- Password:
viewer
- Permissions: Can only read.
Dev
- Email:
dev@mail.com
- Password:
dev
- Permissions: Can read and write.
This component allows the admin to view, add, edit, or remove users.
Functionality
- Add new user to the list
- Edit exisiting user details
- Delete user from the list
User Model
const UserModel = {
name: String,
email: { type: String, unique: true },
role: String,
permissions: [String],
provider: String, //where did the user data come from
// password: { // Password field not required as it is being handled by passport-local-mongoose
// type: String,
// required: true
// },
data: Schema.Types.Mixed
}
API Endpoint
Method: GET
Description: Retrieves a list of all users in the system.
Method: POST
Description: Adds a new user to the system with specified details.
Method: PUT
Description: Updates the details of an existing user based on their email.
Method: DELETE
Description: Deletes a user from the system based on their email.
Method: GET
Description: Retrieves the details of the currently authenticated user.
Allows defining and managing roles with varying permissions, including viewing, adding, editing, or removing roles.
Functionality
- Add new role to the list
- Edit exisiting role details
- Delete user role the list
Role Model
const RoleModel = {
name: String, // Unique role name
description: String, // Description of the role
permissions: [String] // List of permissions assigned to the role
};
API Endpoint
Method: GET
Description: Retrieves a list of all roles in the system.
Method: POST
Description: Adds a new role to the system with specified details.
Method: PUT
Description: Updates the details of an existing role based on its name.
Method: DELETE
Description: Deletes a role from the system based on its name.
Displays the user's profile information, including personal details and settings.
Allows the admin to assign or revoke permissions and to view, add, edit, or remove roles.
Functionality
- Add new permissions to the list
- Edit exisiting permissions
- Delete permission from the list
Permission Model
const PermissionModel = {
name: String, // Unique permission name
description: String // Description of the permission
};
API Endpoint
Method: GET
Description: Retrieves a list of all permissions in the system.
Method: POST
Description: Adds a new permission to the system with specified details.
Method: PUT
Description: Updates the details of an existing permission based on its name.
Method: DELETE
Description: Deletes a permission from the system based on its name.
Displays logs to track user actions and maintain system accountability.
Functionality
- View logs of change in admin panel
- store any edit, add and delete changes made to admin Control Panel
Log Model
const LogModel = {
name: String, // User's name
email: String, // User's email
role: String, // User's role
timestamp: String, // Timestamp of the action
action: String // Description of the action performed
};
API Endpoint
Method: GET
Description: Retrieves a list of all logs for auditing purposes.
Provides a summary of the system's current state, including user statistics and role assignments.