Skip to content

Conversation

@h-kanazawa
Copy link
Contributor

Please remember to request a review from someone when this PR is ready for a code review.

Which issue does this close?

Closes https://learningpool.atlassian.net/browse/LL-143

Describe your changes providing screenshots of UI changes if necessary.

org/all/user/manage scope becomes to be able to view roles.

export default getAdminModelFilter({
viewAllScope: MANAGE_ALL_ROLES,
editAllScope: MANAGE_ALL_ROLES,
viewAllScopes: [MANAGE_ALL_ROLES, MANAGE_ALL_USERS],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This changing fixes the LL-143. MANAGE_ALL_USERS scope can view roles.

case 'view': {
const validScopes = intersection(scopes, [viewAllScope, editAllScope]);
if (validScopes.length > 0) return getOrgFilter(authInfo);
const hasValidViewScopes = [...viewAllScopes, ...editAllScopes].some(s => scopes.includes(s));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The type of viewAllScope was string. viewAllScopes is string[].

Copy link
Member

@ryasmi ryasmi left a comment

Choose a reason for hiding this comment

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

LGTM thanks Hota 👍

@ryasmi ryasmi changed the title Enable to set multiple scopes to a single filter fix(Users Page): Prevents errors when users without "manage roles" scope expand users. (LL-143) Sep 20, 2019
@ryasmi ryasmi merged commit 8ef5a11 into master Sep 20, 2019
@ryasmi ryasmi deleted the LL-143-user/manage-scope-can-not-get-roles branch September 20, 2019 09:20
@HT2Bot
Copy link
Member

HT2Bot commented Sep 20, 2019

🎉 This PR is included in version 4.10.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants