Skip to content

Avoid user_manager permissions to shadow space admin permissions#5698

Merged
tramuntanal merged 5 commits intomasterfrom
fix/avoid_user_manager_permissions_to_shadow_space_admin_permissions
Feb 11, 2020
Merged

Avoid user_manager permissions to shadow space admin permissions#5698
tramuntanal merged 5 commits intomasterfrom
fix/avoid_user_manager_permissions_to_shadow_space_admin_permissions

Conversation

@tramuntanal
Copy link
Copy Markdown
Contributor

@tramuntanal tramuntanal commented Feb 10, 2020

🎩 What? Why?

When a user has both, the user_manager role and the participatory space admin role, the admin menu does not render the participatory space menu option.

This is because Decidim::Admin::Permissions#permissions returns after evaluating the permissions of a user_manager whatever the result. In the exposed case, the correct is to continue evaluating to check if the user has other roles that allow her to perform the action.

📌 Related Issues

  • Related to #?
  • Fixes #?

📋 Subtasks

  • Add CHANGELOG entry
  • Add documentation regarding the feature
  • Add/modify seeds
  • Add tests
  • Fix

📷 Screenshots (optional)

imatge

@tramuntanal tramuntanal self-assigned this Feb 10, 2020
**Fixed**:

- **decidim-admin**: Avoid user_manager permissions to shadow space admin permissions. [\#5698](https://github.com/decidim/decidim/pull/5698)
- **decidim-core**: Fix: display the correct google brand log in omniauth login view. [\#5685](https://github.com/decidim/decidim/pull/5685)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these changes intended? Maybe they come from older code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, there's a duplicated line that appeared when resolving the typo in master's changelog.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This line is still duplicated! 😄

mrcasals
mrcasals previously approved these changes Feb 11, 2020
Copy link
Copy Markdown
Contributor

@mrcasals mrcasals left a comment

Choose a reason for hiding this comment

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

Looks good to me! I left a note about some changes in the Changelog file, but apart from that PR looks good 😄

def collection
# there's an unidentified corner case where Decidim::User
# may have been destroyed, but the related ParticipatorySpacePrivateUser
# remains in the database. That's why filtering by not null users
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👌 nice catch!

return user_manager_permissions if user_manager?
if user_manager?
begin
allow! if user_manager_permissions.allowed?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me!

microstudi
microstudi previously approved these changes Feb 11, 2020
One dulpicated entry and many lines without closing the markdown link with ).
@tramuntanal tramuntanal dismissed stale reviews from microstudi and mrcasals via aa9d236 February 11, 2020 11:52
@tramuntanal tramuntanal merged commit 4f7eb00 into master Feb 11, 2020
@tramuntanal tramuntanal deleted the fix/avoid_user_manager_permissions_to_shadow_space_admin_permissions branch February 11, 2020 14:21
microstudi pushed a commit to Platoniq/decidim that referenced this pull request Feb 21, 2020
…idim#5698)

* Avoid user_manager permissions to shadow space admin permissions

* Add changelog entry.

* Correct changelog entries

One dulpicated entry and many lines without closing the markdown link with ).
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.

3 participants