Skip to content
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

refactor: get permissions from groups, not user object #187

Merged
merged 7 commits into from
Jan 24, 2020

Conversation

kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Jan 22, 2020

Resolves #issueNumber
Impact: major
Type: featurer|refactor

Issue

User permissions are currently checked against the user.roles object that is on a user. In the API, we've updated how permission work and now get permissions (formerly roles) by querying the groups a user belongs too, and attaching the permissions to a user based on the groups permissions.

Solution

Update reaction-admin to get permissions based off of account.groups rather than user.roles. In addition, update all Reaction.hasPermission() checks to use the new permissions we use in the api.

Breaking changes

None

Testing

  1. See that Reaction.hasPermission works as expected

…t user

Signed-off-by: Erik Kieckhafer <ek@ato.la>
…permissions

Signed-off-by: Erik Kieckhafer <ek@ato.la>
Signed-off-by: Erik Kieckhafer <ek@ato.la>
client/modules/core/main.js Outdated Show resolved Hide resolved
imports/plugins/core/core/server/Reaction/core.js Outdated Show resolved Hide resolved
Signed-off-by: Erik Kieckhafer <ek@ato.la>
Signed-off-by: Erik Kieckhafer <ek@ato.la>
Signed-off-by: Erik Kieckhafer <ek@ato.la>
Signed-off-by: Erik Kieckhafer <ek@ato.la>
@kieckhafer kieckhafer dismissed mikemurray’s stale review January 24, 2020 17:21

@mikemurray comments addressed, ready for another check

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mikemurray mikemurray merged commit 0039f43 into trunk Jan 24, 2020
@mikemurray mikemurray deleted the refactor-kieckhafer-updatePermissions branch January 24, 2020 17:52
This was referenced Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants