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

Issue #3433028: Some menus are showing to the user without permission #3830

Merged

Conversation

vcsvinicius
Copy link
Contributor

@vcsvinicius vcsvinicius commented Mar 22, 2024

Problem

After #3418484 some menus start to show to user without permission.

Solution

Add validation to check permission to the menu.

Issue tracker

PROD-28618
#3433028

Theme issue tracker

N/A

How to test

Make test with diferent roles to check the permissions

  1. Notification Center
  • Go to the any page as logged user
  • Change the visualization to mobile
  • Click on user menu on header bar
  • Check if there has "Notification Center" option and click on it
  1. Social Album
  • Enable Social Album module
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "New Album" option and click on it
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "My albuns" option and click on it
  1. Social Book
  • Enable Social Book module
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "New Book Page" option and click on it
  1. Invites
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "Invites" option and click on it
  1. Social Events
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "My events" option and click on it
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "Add Event" option and click on it
  1. Social Follow Content
  • Enable Social Follow Content module
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "Following" option and click on it
  1. Social Follow Taxonomy Term
  • Enable Social Follow Taxonomy Term module
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "Following tags" option and click on it
  1. Social Group
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "New Group" option and click on it
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "My groups" option and click on it
  1. Social Landing Page
  • Enable Social Landing Page module
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "New Landing Page" option and click on it
  1. Social Page
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "New Page" option and click on it
  1. Social Private Message
  • Enable Social Private Message module
  • Change the visualization to mobile
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "Inbox" option and click on it
  1. Social Profile
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "My profile" and "Edit profile" option and click on it
  1. Social Topic
  • Go to the any page as logged user
  • Click on user menu on header bar
  • Check if there has "My topics" option and click on it
  • Go to the any page as logged user
  • Click on plus menu on header bar
  • Check if there has "Add Topic" option and click on it

Definition of done

Before merge

  • Code/peer review is completed
  • All commit messages are clear and clean. If applicable a rebase was performed
  • All automated tests are green
  • Functional/manual tests of the acceptance criteria are approved
  • All acceptance criteria were met
  • New features or changes to existing features are covered by tests, either unit (preferably) or behat
  • Update path is tested. New hook_updates should respect update order, right naming convention and consider hook_post_update code
  • Module can be safely uninstalled. Update/implement hook_uninstall and make sure that removed configuration or dependencies are removed/uninstalled
  • This pull request has all required labels (team/type/priority)
  • This pull request has a milestone
  • This pull request has an assignee (if applicable)
  • Any front end changes are tested on all major browsers
  • New UI elements, or changes on UI elements are approved by the design team
  • New features, or feature changes are approved by the product owner

After merge

  • Code is tested on all branches that it has been cherry-picked
  • Update hook number might need adjustment, make sure they have the correct order
  • The Drupal.org ticket(s) are updated according to this pull request status

Screenshots

N/A

Release notes

This will fix menu link showing for user without permissions.

Change Record

N/A

Translations

N/A

@vcsvinicius vcsvinicius added type: bug Fixes a bug in Open Social status: needs review This pull request is waiting for a requested review prio: high team: guardians labels Mar 22, 2024
@vcsvinicius vcsvinicius added this to the 12.2.4 milestone Mar 22, 2024
@vcsvinicius vcsvinicius requested a review from a team March 22, 2024 15:49
Copy link

mergeable bot commented Mar 22, 2024

Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊

@vcsvinicius vcsvinicius force-pushed the bugfix/3433028/fix-menu-showing-without-permission branch from 0a771e6 to 2e5c46b Compare March 22, 2024 15:57
@vcsvinicius vcsvinicius force-pushed the bugfix/3433028/fix-menu-showing-without-permission branch from 2e5c46b to 756bb43 Compare March 22, 2024 16:07
@ronaldtebrake
Copy link
Contributor

Can confirm this works 👍 as CM and VU

Screenshot 2024-03-25 at 08 31 02

Screenshot 2024-03-25 at 08 31 18

@BiaInacio
Copy link
Contributor

All links are working and are displayed as expected, according to the visibility rules.
image
image

@ronaldtebrake ronaldtebrake merged commit de61d82 into main Mar 25, 2024
187 checks passed
@ronaldtebrake ronaldtebrake deleted the bugfix/3433028/fix-menu-showing-without-permission branch March 25, 2024 14:28
@ronaldtebrake ronaldtebrake added the backport: verified This pull request has been back ported to an older minor version label Mar 25, 2024
@ronaldtebrake
Copy link
Contributor

Cherry picked to 12.2.x, 12.3.x, 12.4.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: verified This pull request has been back ported to an older minor version prio: high status: needs review This pull request is waiting for a requested review team: guardians type: bug Fixes a bug in Open Social
3 participants