-
-
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
Create separate user endpoints for different purposes (admin, org, project) #2238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need both the capability to access all users on FMTM (admin only), plus also users per project (project manager) I think?
So either we need a separate endpoint for these cases, or we need another way to handle this with one endpoint.
I don't think this change will work for both π
We also need to fetch all the users while assigning during project creation. So that would need org admin access. Like you said to fetch all the users by admin, our role management doesn't work even if I am super admin; I would need an org id or project id if the roles are org admin or project admin. I think we need to work around this if he is super admin; he shouldn't have any dependency on org and projects. That being said, it will check for all the users if they are super admin or not, which is not great. Need to rethink a way to allow that. |
I would propose we have three endpoints:
We can keep the role management the same this way π |
Updates:
Response:
[
{
"id": 1,
"username": "localadmin"
},
{
"id": 20386219,
"username": "svcfmtm"
}
]
[
{
"user_id": 1,
"project_id": 143,
"role": "PROJECT_MANAGER"
}
] |
@@ -64,7 +79,7 @@ async def get_user_roles(current_user: Annotated[DbUser, Depends(mapper)]): | |||
async def update_existing_user( | |||
user_id: int, | |||
new_user_data: user_schemas.UserUpdate, | |||
current_user: Annotated[DbUser, Depends(super_admin)], | |||
_: Annotated[DbUser, Depends(super_admin)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach for showing unused vars, similar to other languages
What type of PR is this? (check all applicable)
Related Issue
Describe this PR
org_admin
in backend to fetch users listScreenshots
N/A
Alternative Approaches Considered
Did you attempt any other approaches that are not documented in code?
Review Guide
Notes for the reviewer. How to test this change?
Checklist before requesting a review
[optional] What gif best describes this PR or how it makes you feel?