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

dev/core#1499 - Case Resource shows contact names that are not access… #16150

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

jitendrapurohit
Copy link
Contributor

@jitendrapurohit jitendrapurohit commented Dec 24, 2019

…ible to logged in user

Overview

Fix case resource section from loading inaccessible contacts.

Before

Replicate the problem by following the below steps -

  1. Add contact A, B and C to case resource group.
  2. Create a case for User1 and make sure that user1 is able to access only contact A (add appropriate ACL or relationships, etc).
  3. Log in as User1 and navigate to Manage case screen -> open "Other relationship" panel.
  4. Notice that "Case Resources" section displays all the 3 contacts A, B and C in the list instead of showing only A to the user.

image

After

as admin, I can see all contacts.

image

Masquerading as User1, I can see only accessible contacts from case resources -

image

Comments

Gitlab - https://lab.civicrm.org/dev/core/issues/1499

Added unit test.

@civibot
Copy link

civibot bot commented Dec 24, 2019

(Standard links)

@civibot civibot bot added the master label Dec 24, 2019
@seamuslee001
Copy link
Contributor

This seems fine to me @demeritcowboy @alifrumin thoughts?

@demeritcowboy
Copy link
Contributor

Looks good just one minor thing in the test which needs updating. And I added a historical note in the lab ticket for the record.

  • General standards
    • [r-explain] PASS
    • [r-user] PASS
    • [r-doc] PASS
    • [r-run] PASS
      • Reproduced via ACLs and patch prevents it showing on the Manage Case screen.
      • Test fails before patch and passes after.
  • Developer standards
    • [r-tech] PASS
      • Also did a quick look around to see if it was used elsewhere. This also hides it from the Send Copy section on case activities, and that seems consistent.
    • [r-code] PASS
    • [r-maint] Minor Issue
      • Technically the assertEquals() are all backwards. The expected value should be the first parameter, otherwise when it fails the message "Failed asserting that 0 matches expected 1" can be confusing.
      • Not a blocker. It seems like the test is checking against CMS permissions, and I couldn't see how to reproduce just using CMS permissions, so the test might not prevent regress, but it's still a good test that adds coverage to a function not previously covered.
    • [r-test] PASS

@yashodha
Copy link
Contributor

@jitendrapurohit looks good. Can you look at @demeritcowboy 's suggestion, the patch seems good to merge though.

@seamuslee001
Copy link
Contributor

I'm going to merge this and do the follow up PR as necessary

@seamuslee001 seamuslee001 merged commit af4388a into civicrm:master Jan 7, 2020
seamuslee001 added a commit to seamuslee001/civicrm-core that referenced this pull request Jan 7, 2020
…m is the expected value not the current value
seamuslee001 added a commit that referenced this pull request Jan 7, 2020
[NFC] Test update following PR #16150, assertEquals first param is th…
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