scorelab / OpenMF

An Open Source Mobile Forensics Investigation Tool for Android Platform
Apache License 2.0
150 stars 97 forks source link

[Backend] Created route for admin to add, update role, delete and view users route #76

Closed sachinsom93 closed 3 years ago

sachinsom93 commented 3 years ago

ISSUE FIXES: #61

Description

Implemented route for some funtionality related to admin like

  1. Admin can create users by providing email, role, password, name
  2. Admin can update role of any of his user
  3. Admin can remove any user
  4. Admin can view all of his users

ScreenShots

  1. ScreenShot for addUser route(Only an admin can use this route) addUser

  2. ScreenShot for view all users of an admin(Only for an admin) allUsers

  3. ScreenShot for updating role of a users(Only admin of that user can update his role) update Role

  4. ScreenShot for remove a users(Only admin of that user can remove him) remove

Additional context

I have also added error handing like for missing parameters, check that admin can't create another admin as his user etc.

sachinsom93 commented 3 years ago

I have added some fields in User model for storing admin name for storing email of admin of that user.

Kindly review this @shivanshu1333., please let me know do I need to add anything ?

sachinsom93 commented 3 years ago

@shivanshu1333 Could you please review this ?