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
core-34 Add view-only option on permissioned relationships #12415
Conversation
Change is_permission_a_b and is_permission_b_a to 3 values instead of 2. Update schema, DAO, BAO, view/edit/add, search, report
…was mishandled We need to check for: first_degree_relationship.contact_id_a = second_degree_relationship.contact_id_a first_degree_relationship.contact_id_a = second_degree_relationship.contact_id_b first_degree_relationship.contact_id_b = second_degree_relationship.contact_id_a first_degree_relationship.contact_id_b = second_degree_relationship.contact_id_b but the last one was mishandled.
(Standard links)
|
Yes, I'd be happy to review. Can't happen today, but early next week. I'm excited this is happening! |
@aydun test fail seems unrelated but if you squash your commits & re-push they will run again & hopefully a pretty green tick will follow |
@eileenmcnaughton - that worked ... pretty green tick now showing! |
Passing yay. In your court @agh1 |
|
I just wrote a follow-up to this that adds the |
That eyeball is really creepy looking. Just sayin... |
@agh1 - many thanks for reviewing, and the title enhancement |
@aydun I'm not sure if there's anything better, at least it's not as bad as this icon that used to be in older versions of CiviCRM! But I do think it would be more intuitive to use 2 icons to represent 2 permissions rather than lumping them into 1. So I would do an eye for "view" and an eye plus a pencil for "view + edit" |
@colemanw I think a pencil has usually indicated "go edit this" or "this is editable" rather than "this contact has the power to edit". I had suggested in #11922 (comment) If you're creeped out by I got experimenting: one idea is to put them in squares and give a little color-coding: The one consideration with separate icons is that you'll never have editing without viewing, and the second icon will just be taking up space. |
I understand that the two permissions are intertwined, nevertheless I think having 2 icons to represent 2 permissions is much more clear visually. |
It's a less clockwork orange look |
Yes, I like those - eye and pencil in boxes. |
@aydun does this also handle permission on user dashboard? I mean which links to show or not show depending on the permission granted. |
(This is a follow-on from #11922 but I can't reopen that one, which itself was a replacement for #11892 )
Overview
This adds a new option to permissioned relationships to provide view-only access. Previously, a permissioned relationship always provides edit access.
Before
A permissioned relationship provides view and update access to the other contact. There is no option for view-only access.
After
The permissioned relationship can provide View and Update or View Only access.
Technical Details
The is_permission_a_b and is_permission_b_a fields are changed from 0/1 boolean to 0/1/2. As previously 0 = no access, 1 = edit (view & update). In addition 2 = view only.
For clarity, the constants
CRM_Contact_BAO_Relationship::NONE
,CRM_Contact_BAO_Relationship::EDIT
,CRM_Contact_BAO_Relationship::VIEW
are used.This means all existing permissioned relationships continue to function as now and provide edit access.
Comments
Unit tests are included for normal and second-degree relationships.
Incorporates @agh1's suggestion to use icons on the relationship screen
https://lab.civicrm.org/dev/core/issues/34