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

CRM-19494 Refactoring of permission code #9246

Merged
merged 22 commits into from
Oct 24, 2016
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dddf4bf
added new list permission functions
bjendres Oct 11, 2016
2b8d25f
added check for 'view/edit my contact'
bjendres Oct 11, 2016
9a41e16
cleanup and documentation
bjendres Oct 11, 2016
ea8011f
started unit tests for new list permission functions
bjendres Oct 11, 2016
67df140
adding new list permission functions (wip)
bjendres Oct 12, 2016
134b2b6
unit tests for new list permission functions (wip)
bjendres Oct 12, 2016
c1ebd31
unit tests for new list permission functions (wip)
bjendres Oct 12, 2016
19f13a7
fixed: EDIT implies VIEW
bjendres Oct 12, 2016
c0e8730
fixed bug in the original function
bjendres Oct 12, 2016
3c64583
finished unit tests
bjendres Oct 12, 2016
730afb4
using new Permission::allowList to fix CRM-12645
bjendres Oct 12, 2016
e4541c5
obeying master jenkins
bjendres Oct 12, 2016
340be2e
implementing @eileen's suggestions:
bjendres Oct 13, 2016
163bfad
Fix enotice
eileenmcnaughton Oct 13, 2016
e8a0f9e
Minor in-passing tidy-ups
eileenmcnaughton Oct 13, 2016
98445ac
CRM-12645 fix the code that calls the links function to not whomp it.
eileenmcnaughton Oct 13, 2016
0f76544
CRM-18120 make acl query less debilitating
eileenmcnaughton Feb 29, 2016
135367a
CRM-12645 fix regression in previous refactor
eileenmcnaughton Oct 14, 2016
680a52d
CRM-12645 remove replaced function
eileenmcnaughton Oct 14, 2016
8210399
CRM-12645 remove unused function
eileenmcnaughton Oct 14, 2016
5f652ac
Return explicit FALSE for test expectation
eileenmcnaughton Oct 14, 2016
9aea8e1
CRM-19557 Fix ACL caching function to not use inefficient query for v…
eileenmcnaughton Oct 24, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CRM/Contact/BAO/Contact/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public static function allow($id, $type = CRM_Core_Permission::VIEW) {
$contactID = CRM_Core_Session::getLoggedInContactID();

// first: check if contact is trying to view own contact
if ($type == CRM_Core_Permission::VIEW && CRM_Core_Permission::check('view my contact')
|| $type == CRM_Core_Permission::EDIT && CRM_Core_Permission::check('edit my contact')
if ($contactID == $id && ($type == CRM_Core_Permission::VIEW && CRM_Core_Permission::check('view my contact')
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, thanks for spotting this.

|| $type == CRM_Core_Permission::EDIT && CRM_Core_Permission::check('edit my contact'))
) {
return TRUE;
}
Expand Down