You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Graph Api] Normal user not authorized to get their assigned role #5583
Normal users ( user with role User, Guest, SpaceAdmin) are not authorized to get their assigned roles. Only admin user can get their assigned role.
Steps to reproduce
Steps to reproduce the behavior:
create user rosy with role User
do API request to get assign role curl -vk -X GET -u rosy:rosy https://localhost:9200/graph/v1.0/users/05e63eb1-d2e3-40b5-966e-97e0cbe22dd8/appRoleAssignments
changed the title [-]Normal user not authorized to get their assigned role [/-][+][Graph Api] Normal user not authorized to get their assigned role [/+]on Feb 16, 2023
@kulmann my question /graph/v1.0/users/<id>/appRoleAssignments is this admin endpoint? Do only admin can access this endpoint?
Is it the design that the user with role like User, SpaceAdmin, Guest can GET to his/her assigned role ?
If yes, through which api endpoint can a normal user can know his/her app role
In setting api we have https://host.docker.internal:9200/api/v0/settings/roles-listthrough which user get their assigned role
I don't know how the endpoint is secured in the backend, but at least I can tell you that the endpoint is not relevant for a non-admin user. IMO it should only be available to admins.
At the moment the settings api is used to get the role of the user (like you mentioned it). As soon as web transitioned to the new permissions endpoint we will not fetch the role of the logged in user anymore in web.
That's why I wanted to know what you plan to do with the role. An API test for just checking the role of the logged in user is not needed.
Activity
[-]Normal user not authorized to get their assigned role [/-][+][Graph Api] Normal user not authorized to get their assigned role [/+]kulmann commentedon Feb 16, 2023
Question, why would you expect to be able to retrieve the assigned role of the user?
The
userthat you can retrieve via graph should contain the role.amrita-shrestha commentedon Feb 16, 2023
@kulmann my question
/graph/v1.0/users/<id>/appRoleAssignmentsis this admin endpoint? Do only admin can access this endpoint?Is it the design that the user with role like User, SpaceAdmin, Guest can GET to his/her assigned role ?If yes, through which api endpoint can a normal user can know his/her app role
In setting api we have
https://host.docker.internal:9200/api/v0/settings/roles-listthrough which user get their assigned rolekulmann commentedon Feb 16, 2023
@amrita-shrestha
I don't know how the endpoint is secured in the backend, but at least I can tell you that the endpoint is not relevant for a non-admin user. IMO it should only be available to admins.
At the moment the settings api is used to get the role of the user (like you mentioned it). As soon as web transitioned to the new permissions endpoint we will not fetch the role of the logged in user anymore in web.
That's why I wanted to know what you plan to do with the role. An API test for just checking the role of the logged in user is not needed.
amrita-shrestha commentedon Feb 16, 2023
@kulmann thank you for the information. So that means closing this issue will be OK.
v-scharf commentedon Feb 16, 2023
I discus also with @C0rby about it. Behavior is expect. endpoint was implemented only for admin user. we can close issue