Answers.Body: <p>Smart Groups could be a pain in the ass in CiviCRM. They are a powerful feature but when it does not work it is hard to get it working again.</p>
  
  <p>There are some alternatives to smart groups. The <a href="https://civicrm.org/extensions/sql-tasks-extension-configurable-recurring-tasks" rel="nofollow noreferrer">SQL Tasks Extension</a> or <a href="https://civicrm.org/extensions/civirules" rel="nofollow noreferrer">CiviRules</a> can add contacts to a regular group based on a Query (with SQL Tasks) or on a Trigger (with CiviRules). You can then setup this regular group as an ACL Group.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-12T10:45:48.690Z
Answers.LastActivityDate: 2018-02-12T10:45:48.690Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>Is it possible to create an ACL associated with a Smart Group?</p>
  
  <p>I'm attempting to create a members directory that is only accessible to members. I can't seem to get it working. Here's what I've done so far:</p>
  
  <ul>
  <li>I created a Smart Group called "Active Members" that includes any member of the club (status new, current or grace).</li>
  <li>I made the Group “Members” as the parent group of the Smart Group "Active Members" created above. This had the effect of making the Smart Group disappear, and when you click on the list of members of “Members” it lists everyone that matched the search criteria for the Smart Group.</li>
  <li>I created an ACL Role “Member”.</li>
  <li>I assigned the Group “Members” to the Role “Member”</li>
  <li>I created an ACL allowing anyone with the Role “Member” to access the Profile “Directory” to perform the operation “Search”</li>
  </ul>
  
  <p>After doing all that, I figured I had it. This was going to work, and all would be right with the world. I was wrong.</p>
  
  <p>The next thing I did was to create a new ACL allowing anyone with the role “Authenticated” to access the Profile “Directory” to perform the “Search” operation. Then it worked. However, if I understand this correctly, this means anyone that logs in, regardless of their membership status, will have access to the directory.</p>
  
  <p>What troubles me is that the Member Role, which is associated with the “Members” group, which appears to contain all of the active members (by way of a child Smart Group) should have allowed it to work without having to widen the scope to “Authenticated”. I’m guessing that the child group doesn’t inherit the permissions of the parent group.</p>
  
  <p>I don't want to manually add my members to the group members, I want that to be automatically governed by the status of their membership, hence the use of the Smart Group.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-15T18:09:47.593Z
Comments.Text: Which CMS are you using?
Comments.UserDisplayName: Catorghans
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-15T18:25:18.577Z
Comments.Text: Fair point. We're using WordPress 4.5 and CiviCRM 4.7.6.
Comments.UserDisplayName: Paul Dufresne
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-15T19:26:11.960Z
Comments.Text: I swear we had this working last year with wordpress using civicrm ~4.5.6. It was broken in earlier versions, bug filed, fixed... it has since broken again. We can't get this to work, not even with static groups. There are bugs filed but they are not being worked on as far as I can tell. ACLs generally seem to be buggy from what I have experienced.
Comments.UserDisplayName: P a u l
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-15T19:27:39.797Z
Comments.Text: Well, that's not very promising... So it's not a me just being an amateur with CiviCRM then... I was afraid I was asking a stupid question!
Comments.UserDisplayName: Paul Dufresne
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-15T19:27:47.483Z
Comments.Text: See also: http://civicrm.stackexchange.com/questions/10064/acl-controls-not-working-with-smart-groups
Comments.UserDisplayName: P a u l
Tags: <profile><groups><acl><roles>
Title: Creating ACL for Smart Groups
ThreadText: # Creating ACL for Smart Groups
  
  (Asked by: username_0 on 2016-04-15)
  
  Is it possible to create an ACL associated with a Smart Group?
  
  I'm attempting to create a members directory that is only accessible to members. I can't seem to get it working. Here's what I've done so far:
  
  * I created a Smart Group called "Active Members" that includes any member of the club (status new, current or grace).
  * I made the Group “Members” as the parent group of the Smart Group "Active Members" created above. This had the effect of making the Smart Group disappear, and when you click on the list of members of “Members” it lists everyone that matched the search criteria for the Smart Group.
  * I created an ACL Role “Member”.
  * I assigned the Group “Members” to the Role “Member”
  * I created an ACL allowing anyone with the Role “Member” to access the Profile “Directory” to perform the operation “Search”
  
  After doing all that, I figured I had it. This was going to work, and all would be right with the world. I was wrong.
  
  The next thing I did was to create a new ACL allowing anyone with the role “Authenticated” to access the Profile “Directory” to perform the “Search” operation. Then it worked. However, if I understand this correctly, this means anyone that logs in, regardless of their membership status, will have access to the directory.
  
  What troubles me is that the Member Role, which is associated with the “Members” group, which appears to contain all of the active members (by way of a child Smart Group) should have allowed it to work without having to widen the scope to “Authenticated”. I’m guessing that the child group doesn’t inherit the permissions of the parent group.
  
  I don't want to manually add my members to the group members, I want that to be automatically governed by the status of their membership, hence the use of the Smart Group.
  
  **Tags:** profile, groups, acl, roles
  
  > **Comments:**
  > **username_1**: Which CMS are you using?  
  > **username_0**: Fair point. We're using WordPress 4.5 and CiviCRM 4.7.6.  
  > **username_2**: I swear we had this working last year with wordpress using civicrm ~4.5.6. It was broken in earlier versions, bug filed, fixed... it has since broken again. We can't get this to work, not even with static groups. There are bugs filed but they are not being worked on as far as I can tell. ACLs generally seem to be buggy from what I have experienced.  
  > **username_0**: Well, that's not very promising... So it's not a me just being an amateur with CiviCRM then... I was afraid I was asking a stupid question!  
  > **username_2**: See also: http://civicrm.stackexchange.com/questions/10064/acl-controls-not-working-with-smart-groups  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-02-12. Score: 4
  
  Smart Groups could be a pain in the ass in CiviCRM. They are a powerful feature but when it does not work it is hard to get it working again.
  
  There are some alternatives to smart groups. The [SQL Tasks Extension](https://civicrm.org/extensions/sql-tasks-extension-configurable-recurring-tasks) or [CiviRules](https://civicrm.org/extensions/civirules) can add contacts to a regular group based on a Query (with SQL Tasks) or on a Trigger (with CiviRules). You can then setup this regular group as an ACL Group.
  
  
  ---
  
  