-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Move roles and group.permissions code from account plugin to simple-auth plugin #6111
Merged
Conversation
This file contains 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
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Eric Dobbertin <[email protected]>
Also cleanup of createAccountGroup and updateAccountGroup mutations Signed-off-by: Eric Dobbertin <[email protected]>
aldeed
force-pushed
the
fix-aldeed-remove-ensure-roles
branch
from
February 26, 2020 01:30
91f5b14
to
4cac771
Compare
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Eric Dobbertin <[email protected]>
rosshadden
previously approved these changes
Feb 28, 2020
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
…commerce/reaction into fix-aldeed-remove-ensure-roles
kieckhafer
approved these changes
Feb 28, 2020
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.
Added [email protected]
.
Works as expected with that release.
Merged
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.
Impact: minor
Type: feature
Issue
Some code in the
account
plugin references things that are now the domain of the newsimple-authorization
plugin. This makes it difficult to remove thesimple-authorization
plugin and replace it with a different authorization solution.Solution
roles
(collection, queries, util fns, etc.) to thesimple-authorization
plugin.group.permissions
array to thesimple-authorization
plugin as an extension of theGroup
type.Breaking changes
None
Testing
createAccountGroup
andupdateAccountGroup
mutations continue to work as expected, and allow you to pass in apermissions
array as part ofgroup
.Query.roles
andshop.roles
GQL queries continue to work. They should return all the built-in permissions as well as any other strings you pass in thepermissions
array when callingcreateAccountGroup
orupdateAccountGroup
mutation.permissions
field onGroup
type in GraphQL.system-manager
group.Testing Queries
createAccountGroup
mutation:updateAccountGroup
mutation:Create global group with permissions
The first account, and any account in the "system-manager" group, should be able to create a global group with the above mutation and input like this:
Update global group permissions
The first account, and any account in the "system-manager" group, should be able to update a global group with the above mutation and input like this:
(Use actual
groupId
, such asgroup._id
returned bycreateAccountGroup
.)Create shop group with permissions
Any account in the "shop-manager" group for a shop should be able to create a shop group with the above mutation and input like this:
Update shop group permissions
The first account, and any account in the "system-manager" group, should be able to update a global group with the above mutation and input like this:
(Use actual
groupId
, such asgroup._id
returned bycreateAccountGroup
.)Get a group with permissions
Get shop roles
An account in shop manager group should be able to do this query for the shop:
And verify the correct roles list comes back.
Get shop roles
An account in shop manager group should be able to do this query for the shop:
And verify the correct roles list comes back.