Repository navigation
Keep vendors, store managers and sales managers out of the admin API - #1089
Merged
Merged
Conversation
The admin API works on all data. The admin panel already turns away vendors and store managers, and admits a sales manager only to the customers and orders of their sales employee. The API filter checked only the admin panel permission, so these roles reached every record through it. The filter now turns them away the same way. The API has no sales employee scope, so a sales manager is turned away whether or not a sales employee is assigned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The admin API works on all data. The admin panel turns away vendors and store managers, and lets a sales manager see only the customers and orders of their sales employee. The API filter checked only the admin panel permission, so these roles reached every record through the API.
Changes
AuthorizeApiAdminAttribute: a vendor (group or vendor account), a store manager (group or staff store) and a sales manager get 403, the same roles the admin panel turns away. The API has no sales employee scope, so a sales manager is turned away even with a sales employee assigned.Tests
AuthorizeApiAdminAttributeTests: five new cases, one per role marker.Grand.Module.Api.Tests(115) pass.