CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook_civicrm_aclWhereClause - called under what circumstances?
Pages: [1]

Author Topic: hook_civicrm_aclWhereClause - called under what circumstances?  (Read 1326 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
hook_civicrm_aclWhereClause - called under what circumstances?
June 21, 2009, 04:05:29 am
I'm trying to understand under what circumstances a particular user will have contact access permissions applied to them.

Is this correct?

 * If the user's role has "edit all contacts" permission, then they can access all contacts, no matter what.
 * If the user's role does not have "edit all contacts", then contact access is dictated by the query as modified by hook_civicrm_aclWhereClause
 * (presumably CiviCRM's builtin ACL config applies in the case that it has been configured, with modifications applied in hook_civicrm_aclWhereClause if applicable)
 * If hook_civicrm_aclWhereClause is not implemented, the user has access to no contacts whatsoever
@xurizaemon ● www.fuzion.co.nz

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: hook_civicrm_aclWhereClause - called under what circumstances?
September 05, 2010, 06:51:49 pm
"This function will not be called at all if the logged in user has access to the "edit all contacts" permission." - CiviCRM Hook Specification.

Unsure how this relates to "view all contacts" permission and searches, though.
« Last Edit: September 05, 2010, 06:53:36 pm by xurizaemon »
@xurizaemon ● www.fuzion.co.nz

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: hook_civicrm_aclWhereClause - called under what circumstances?
September 05, 2010, 07:48:48 pm
Quote
If hook_civicrm_aclWhereClause is not implemented, the user has access to no contacts whatsoever
This one is incorrect.  A corrected version would be:
"If hook_civicrm_aclWhereClause is not implemented, CiviCRM's buil-in ACL config applies, unmodified."

Also, I know that in civicrm 3.1.x, "view all contacts" would cause this hook to be bypassed just as "edit all contacts" does.  But I haven't had cause to use it in 3.2.

- TM
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: hook_civicrm_aclWhereClause - called under what circumstances?
September 05, 2010, 09:10:04 pm
Thanks. Yes, it was the discovery of "view all contacts" in 3.x which made me dredge up this old thread today. Appreciate your clarification TwoMice.
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook_civicrm_aclWhereClause - called under what circumstances?

This forum was archived on 2017-11-26.