I've done some searching, but can't seem to hit the right keywords. I'll pick on the major donor group for this question, though it would apply in other ways.

Most of our users should have access to almost all of the contacts. However, there is a small group who deal with major donors. This group is only group who should be able to see the major donors.

Currently we are using a group for major donors, and a smart group for anybody who is not in the major donor group. The majority of users are in a user group that allows them to edit anyone in the unrestricted contact group. This works great, except when adding a new contact.

When the new contact is not in the major donor group, the majority of users still can't see the new user until the cron job runs to rebuild the smart group cache. This messes with people's process and they loose where they are and what they are doing.

Is there a better way to restrict the group? Can I set an ACL so that it's looking at anything that's NOT a part of a group, rather than a part of a group? Anybody else doing something similar with a better way of doing this? Can I set all new contacts to automatically be a part of the unrestricted smart group by default?

1 Answer 1


No, ACLs are about including groups you can see, not about excluding the ones you can't.

What we did for a case like you was to automatically add any new contact into a "visible by everyone" group and remove it if/when they are added to the "VIP" group. So what you do with smartgroups, but because we add/remove directly, it was faster as no need to wait for the cache to rebuild. It was a very long time ago, so probably nothing I can share anymore, but with two hooks in a small extension, it should be possible

Have a look at civirules, it might even be possible to do it without code.

  • That's about what I was expecting. Unfortunately, it doesn't seem that CiviRules has made the jump to 4.7 yet, nor is it currently on any road map to do so. (Knew I should have held back! Oh well.) However, this begs a couple of questions. First, is there a particular reason that ACL's aren't = and !=? Secondly, anyone have a good example to look at for the hooks Xavier mentions? I don't get enough practice to be a real coder, but I can copy and paste!
    – G H
    Feb 19, 2016 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.