[WX-1764] Fix improper authorization for POST list method permissions #339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira: https://broadworkbench.atlassian.net/browse/WX-1764
Changes to
POST /api/v1/methods/permissions
API response:entity
information that was already present in request is still returned for unauthorized access as not to break existing expectations and with the intention to have minimal changesNote: I decided not to change anything for PUT API for upsert permissions because it seems the response for this API even for unauthorized access only returns information that was already present in the request. This shouldn't be a problem and was confirmed with AppSec (see this comment). I had initially tried to change the response to return empty
entity
andacls
in response for unauthorized user but reverted that change as I am not sure how and where this API is used and didn't want to break any existing expectations. And since it is fine from security perspective there is no need to change it currently.Request body for POST /api/v1/methods/permissions
Response for POST /api/v1/methods/permissions
BEFORE
AFTER