-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return db user instead of Auth User in me endpoint. #1247
Conversation
This was an intentional choice at the start to prevent the extra database call, if it's not needed. I'm assuming the frontend needs to store the role from one of: READ_ONLY, MAPPER, or ADMIN for something? I'm not that confident in enforcing roles via the frontend - this is easily manipulated. Each endpoint we call has associated auth/role requirements anyway. It depends what the role is needed for π |
Only superusers are allowed to view these tags. |
The organisation page is low priority for now, but I wanted to get some feedback related to #1234 @NSUWAL123 @Sujanadh @manjitapandey The idea here is that we can distinguish more easily between verified and unverified orgs - which sounds great on paper. The admin for FMTM is generally only one user, maybe a handful at most. They will generally be technically proficient, with access to the database etc. Do we think it's necessary to make UI components and endpoints specific for admin users, when they can just update things via the database? |
I understand that if its only about super admin role and we are sure that we wont be needing it on future, calling two databases won't probably a good idea. |
If the user is an admin then all orgs are returned. We just need to tag the unapproved orgs to give better oversight of that for the admin. To do that we don't need to check if the user is admin, we only need to check if the org has approved=false (note that regular users can't list unapproved orgs from the backend). Then in the future we can convert the tag to a button, so the admin clicks and it calls the approve endpoint. Would that work? |
Closing unless a good use case is determined. |
Apologies, I stupidly closed this as it doesn't actually impact anything. |
What type of PR is this? (check all applicable)
Related Issue
user_role
was not updated inme
endpoint. The default mapper role was passed, irrespective of other roles.Describe this PR
This PR updates
me
endpoint, which returnsdbuser
with respective roles instead ofauthuser
, asauthuser
doesn't possess any roles.Screenshots
N/A
Checklist before requesting a review
[optional] What gif best describes this PR or how it makes you feel?