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
API requests from an unauthorized user should return 403 #5938
Now the 401 Unauthorized vs 403 Forbidden vs 404 Not Found status code may look tricky, but hara are the guidelines:
we don't want to expose existence of resources if a user has no access to them, so we return a 404 Not Found instead of a 403 Forbidden.
when a user has access to a resource but tries to execute an action that he does not have enough permissions for, e.g. when he tries to write to a read only share, we return a 403 Forbidden
If we could decide on the expected behavior (status-code) on non-admin user trying to do admin things then we can adjust the tests accordingly.
when a user has access to a resource but tries to execute an action that he does not have enough permissions for, e.g. when he tries to write to a read only share, we return a 403 Forbidden
I agree with that in the current context. So 403 is the way to go.
Scenario Outline: user with role user and guest cannot disable other space via the Graph API
Scenario Outline: user with role user and guest cannot delete others disabled Space via the Graph API
This returns 404 which (I think) is expected because the space has not been shared to them
Activity
amrita-shrestha commentedon Mar 27, 2023
discussed in #5742 (comment)
saw-jan commentedon Jul 9, 2024
#5742 (comment)
If we could decide on the expected behavior (status-code) on non-admin user trying to do admin things then we can adjust the tests accordingly.
CC @micbar
micbar commentedon Jul 9, 2024
I agree with that in the current context. So 403 is the way to go.
saw-jan commentedon Jul 18, 2024
This returns
404which (I think) is expected because the space has not been shared to them