Problem/Motivation
I am creating a "member list", where users in a given role can see the other users (and mapped contact entities) on the site in a listing. Therefore I gave the "View any contact" permission to that role.
When users in that role view the listing, they can see the Contact entity fields.
However, fields using "Contact detail" config entity references do not fully show.
For example the Telephones field shows the telephone number, but not the contact detail (e.g. Main, Mobile, Fax, ...).
The phone number itself is a regular field on the crm_contact_method entity, which the user can view (access is delegated to the parent CRM contact).
The detail however is a reference to a config entity that requires admin permission ("administer crm") to view, which I obviously will not give to users in this role.
Proposed resolution
Add access control logic for contact detail config entities.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | After patch.PNG | 31.9 KB | anjuelsaphilip2020 |
| #9 | Before patch.PNG | 25.67 KB | anjuelsaphilip2020 |
Issue fork crm-3571861
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
svendecabooterComment #4
svendecabooterComment #8
svendecabooterComment #9
anjuelsaphilip2020 commentedHi, I’ve verified and tested MR !192 and applied the patch successfully on CRM 1.0.x-dev. The changes are working as expected.
Following steps I followed:
Testing Result: After applying the patch, contact detail labels (Main / Mobile / Fax) are displayed correctly for users with “View any contact” permission, without requiring administer crm access.
Attaching screenshots for reference.
Thanks
Comment #10
bluegeek9 commentedThe average user really only needs viem label access to the Method Details.
Instead of granting view and view label access if the user has 'view any crm contact', or 'view mapped crm contact', could we grant everyone view label access? The other operations would still require "administer crm".
Comment #11
bluegeek9 commentedComment #14
bluegeek9 commentedComment #16
bluegeek9 commented