civicrm / org.civicrm.civicase

CiviCase Extension
Other
9 stars 35 forks source link

CATL-933: Add Basic View Permission #97

Closed MiyaNoctem closed 6 years ago

MiyaNoctem commented 6 years ago

Overview

A new permission should be created which would allow users to see “basic case information” for any contacts that they can view. Basic case information would be seem to be the ability to view the Case information table only and not to open the case itself to view any more details, nor to navigate to or edit any case or case activity directly.

Before

If a user had access to cases, they could only have complete access to edit the case and case activities.

After

The following modifications were implemented:

  1. Added new permission using hook_civicrm_permission().
  2. Disabled bulk action select combo and hide case selection checkboxes on manage cases table view if the user only has view basic information permission.
  3. Removed Next Activity column from manage cases table view if the user only has 'view basic information' permission.
  4. Removed link to case detail view.
MiyaNoctem commented 6 years ago

@colemanw ,

Can you review this PR?

colemanw commented 6 years ago

Hmm, it looks like you are doing a reverse permission here. So you've created a "permission" called "basic case information" which actually restricts access to full case data. So granting a user this permission actually revokes a permission. That's not how permissions work in the rest of CiviCRM and I think it could be problematic.

shitijg commented 6 years ago

@colemanw we did it like that initially, but we have made changes conforming to CiviCRM permission standards. If you have a higher permission, basic case permission will not revoke your higher access. Fully understand your concern here, we did identify this in our previous round of unit testing and have fixed it! cc: @MiyaNoctem @jamienovick

Best, Shitij

colemanw commented 6 years ago

Ok great. Another question: how does this new permission interact with the "access all/access my" case permissions? Are those both considered "higher" permissions and supercede it?

If so then would a person with "access my cases" and "basic case" permissions but not "access all cases" permission see a list containing every case but only be allowed to open the ones belonging to them?

shitijg commented 6 years ago

Thanks for your comments. Basically this permission will not alter any other existing case permissions. This is targeted at users that do not have access to Cases at all. They will just see the cases tab in a contact page (which will have basic information - only tabular view) for the contacts they can view. They will not be able to see the cases tab in the main menu (unless they have other case permissions - which will then supercede this permission)

The other case related permissions will run independently as they were. Does that make sense?

colemanw commented 6 years ago

Ok so they will not be able to access the new angular civicase UI at all? No case dashboard, or search, or case list screens?

shitijg commented 6 years ago

Exactly, the user will not see any of the angular case UI as you said. This permission only allows a user to see the cases tab in the contact page (with basic tabular information - non-clickable)

guanhuan commented 6 years ago

To clarify this, let's not referring to "angular case UI" unless you meant any of the new case screens. The contact page case tab and activity tab are also angular UI if you have the new case extension enabled.

With only the "basic information" permission, the admin will not be able to see or access the "CiviCase" navigation menu and its children menu items at all. However, the admins will be able to: