-
-
Notifications
You must be signed in to change notification settings - Fork 824
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-20441 further fixes & tests for api + acl #10251
CRM-20441 further fixes & tests for api + acl #10251
Conversation
eileenmcnaughton
commented
Apr 25, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-20441: Fatal error on contact summary for ACL'd user (from activity tab count)
This is not quite there yet - but I think the trick is here We just need to get the ACL adder to add a permissioned join onto ACL_Contact - pretty much whenever |
c56cb6b
to
f0a2c92
Compare
@seamuslee001 @colemanw @monishdeb @davejenx I think this is the right fix for now..... If moves all ACL checking to the api & it checks all rows if permissions are set. This is an expansion of our api application. I think we could do better next round by doing a join check rather than row-by-row & I have commented where I see us adding it. There is a performance cost in some cases of doing this check - we should keep improving on that, however, it might not have much impact since previously we were blocking if id was not set or contact_id was set, now we are checking those. We were already checking in the other scenarios. Also, the api no longer throws exceptions when permissions checks fail on a per-activity basis - that is correct from an api POV but we should do a click-around. @colemanw I couldn't figure out how to force an ACL'd join on the contact_id table, so fell back to the row-by-row check. I would like to know how, although probably we should change all places that call the check function to call the api first, then optimise it within the api |
f0a2c92
to
03895de
Compare
03895de
to
26583d3
Compare
Per discussion in JIRA I have changed the behaviour on 2 tests - turns out one was written by Seamus & one by me, in order to set a baseline for changing behaviour $params['id'] now supports NOT IN etc & test altered to reflect. 'view all activities' is not required when $params['id'] is empty. Instead there is a post-filter |
@seamuslee001 what do you think? Merge this now? I'm inclined to on the basis it
|
Agreed |
Reverted my cherry-picking for the previous PRs, rebased to a clean 4.7.19-rc and checked that #10251 was in git log. Then re-tested. Success: this fix also worked... Fixes the fatal error. Contact summary now displays, with Activities tab showing count = 0. As a further test, I tried adding an activity to one of the allowed contacts that didn't have any activities. I set source = one of the allowed contacts, target = another of the allowed contacts, no assignee. So that should be visible to the restricted user - and it is: count = 1 on Activities tab, can view activity. Hooray! Have commented on CRM-20441. |