ohcnetwork / tracker

https://tracking.coronasafe.in
MIT License
0 stars 6 forks source link

Create User Feature #6

Open gigincg opened 4 years ago

gigincg commented 4 years ago

Build a Component to Create a User and Set privileges to the new or existing users. One of the features of the project that extend decentralization is for users to be allowed to create users with equal or lesser privileges. For Instance a District admin can create a user with either of the following permissions:

  1. Another District Admin.
  2. An Admin who has control over multiple PHCs/Facilities
  3. An Admin who has access to only a single PHC.

We need to build UI components to allow the creation of users with minimal information and to search and allot a set of PHCs to the new user. (A searchable list of PHCs with a select all option should be able to pull this off).

albseb511 commented 4 years ago

for api on create users, the role has to be defined in this case right?

are these correct?

get users api

path: '/api/v1/users'

for updating existing users, adding the role field? path: '/api/v1/users', method: 'PATCH'

So an admin who has access to lets say 1-10 facilities out of 1-100 can they have access to other facilities, is this disabled from api?

An admin with single PHC can add only to that existing PHC.

gigincg commented 4 years ago

Yes, these are new APIs that are under dev. We'll hopefully have them soon.