Open pallabez opened 2 years ago
@pallabez Can you please confirm if anyone has already started working on this issue?
Nope. Would you like to take this up?
Sure @pallabez. Let me first start with understanding the current workflow and then I'll propose the relevant changes.
@pallabez Following are the changes that I am proposing
Problem Statement Currently, Under Members Tab, we have a List of all the People, separated by Designers, Members and New members. Currently, the Designer's data is mocked.
Assumptions:
Collection Name - professional_tags User field name - profession_tags type : Object
Why not call it tags
or maybe use the existing roles
field? That way we can let them have access to API based on their roles
Hey @pallabez
Currently the roles are exported from a constant file, so we need to store these roles (these will be default roles ) in the roles
collection in the database (These will be default roles).
We can use this roles collection to store the tags / professional_tags based on the following assumptions.
In users collection we are storing the roles as follows
user: { roles: { SUPER_USER: 1, MEMBER: 1 } }
So Let's suppose we have implemented our changes and now a document in the user's collections will be as follows
user: { roles: { SUPER_USER: 1, MEMBER: 1, DEVELOPER: 1, DESIGNER: 1, } }
So as a SUPER_USER I change the name of the DEVELOPER TO SOFTWARE_DEVELOPER in the roles collection in that case I need to change the existing occurrence of the DEVELOPER in the Users collection.
Instead of the latter approach, we can store some unique value (uniquely generated code maybe) that we can use to perform a lookup in roles collection.
Yes I do agree that tags
can be used instead of professional_tags
but at the same time I believe that the name should be self-explanatory
Yet To Be Decided
@pallabez Here is the high-level architectural diagram of the relationship between users and roles collection.
@pallabez as discussed I am not creating a new collection but modifying role constants and relevant files to keep the latency low and maybe in the future, we can go with the above approach.
Hey @ganshul34 can we use a collection called tags which contains all types of tags, @Mir-SA is working on it
we can store all these tags in the tags collection and give it a type roles
and then in the roles fields in the user object we can use the ID of these tags
check this issue