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

Block access to contact information updated #14315

Open
wants to merge 17 commits into
base: 5.2
Choose a base branch
from

Conversation

shinde-rahul
Copy link
Contributor

@shinde-rahul shinde-rahul commented Dec 3, 2024

Q A
Bug fix? (use the a.b branch) 🟢
New feature/enhancement? (use the a.x branch) 🔴
Deprecations? 🔴
BC breaks? (use the c.x branch) 🔴
Automated tests included? 🟢
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #...

Description

This PR fixes the handling of unexpected exceptions and the access to contact information without the necessary permissions.

Before After
before after

📋 Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Remove all contact permissions (email:emails:viewown, email:emails:viewother)
  3. Navigate to a segment details view, click on contacts
  4. The contacts included in the segment are visible

The contact grid is permission is updated for Campaign and Email details page, out of which Email pages has the issue as mentioned in the description so updated testing steps are,

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Create a non-admin user with the following permission
    1. Email: View Own, View Others, Create
    2. Contacts: View Own, View Others, Create
  3. Create contacts with different owners and create segments for these contact
  4. Create a broadcast or segment-type email and select the above-created segment.
  5. Run the broadcast
  6. Navigate to the email details page and click on the Contact tab
  7. The contact grid will start showing up

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.42%. Comparing base (43df2ae) to head (18f942d).
Report is 14 commits behind head on 5.2.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                5.2   #14315   +/-   ##
=========================================
  Coverage     63.41%   63.42%           
  Complexity    34627    34627           
=========================================
  Files          2273     2273           
  Lines        103591   103595    +4     
=========================================
+ Hits          65691    65703   +12     
+ Misses        37900    37892    -8     
Files with missing lines Coverage Δ
...s/CampaignBundle/Controller/CampaignController.php 69.33% <100.00%> (+1.36%) ⬆️
...bundles/EmailBundle/Controller/EmailController.php 64.36% <100.00%> (ø)
...dles/LeadBundle/Controller/EntityContactsTrait.php 79.16% <100.00%> (+5.83%) ⬆️

@shinde-rahul shinde-rahul marked this pull request as ready for review December 3, 2024 15:48
@shinde-rahul shinde-rahul added ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging campaigns Anything related to campaigns and campaign builder email Anything related to email contacts Anything related to contacts labels Dec 3, 2024
@andersonjeccel
Copy link
Contributor

@shinde-rahul

Created a role and a user assigned to the role

You said to remove email permissions, removed
Also removed most related to contacts

image

image

Saved

image

logged in the user

image

Still able to see contacts within a segment

image

I'm sure to have your branch checked locally

image

Do I need to do something additional for it to take effect?

@shinde-rahul
Copy link
Contributor Author

@andersonjeccel I have updated the description with updated testing steps,

The contact grid is permission is updated for Campaign and Email details page, out of which Email pages have the issue as mentioned in the description, so updated testing steps are,

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Create a non-admin user with the following permission
  3. Email: View Own, View Others, Create
  4. Contacts: View Own, View Others, Create
  5. Create contacts with different owners and create segments for these contact
  6. Create a broadcast or segment-type email and select the above-created segment.
  7. Run the broadcast
  8. Navigate to the email details page and click on the Contact tab
  9. The contact grid will start showing up

Copy link

@JonasLudwig1998 JonasLudwig1998 left a comment

Choose a reason for hiding this comment

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

Works from an user perspective, great job

@matbcvo
Copy link
Contributor

matbcvo commented Dec 13, 2024

@shinde-rahul please rebase your PR onto the 5.2 branch.

@matbcvo matbcvo added the needs-rebase PR's that need to be rebased label Dec 13, 2024
@shinde-rahul shinde-rahul changed the base branch from 5.x to 5.2 December 14, 2024 03:59
@shinde-rahul shinde-rahul removed the needs-rebase PR's that need to be rebased label Dec 14, 2024
@shinde-rahul
Copy link
Contributor Author

Changed the base branch to 5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
campaigns Anything related to campaigns and campaign builder code-review-needed PR's that require a code review before merging contacts Anything related to contacts email Anything related to email ready-to-test PR's that are ready to test
Projects
Status: 🧑🏻‍💻 Needs a code review
Development

Successfully merging this pull request may close these issues.

7 participants