Answers.Body: <p>Sounds like a bug to me, at least for the ACLs. I am quite surprised that you can see groups that have not been flagged as "mailing list". Can you please provide specifics on the version you are using, as well as the way you have setup these ACLs? Also, on the Manage Groups screen, do you see the same groups or a different list? Finally, do users that have different ACLs than yours have the same issue?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-31T17:53:52.537Z
Answers.Text: v4.6.3
  
  ACLs
  Role "Org 1 Staff" created & assigned group with the same name
  Role "Org 1 Staff" allowed to edit the group "Org 1 Universe"
  Role "Org 1 Staff" allowed to edit the group "Org 1 Staff" (Access Control)
  Role "Org 1 Staff" allowed to edit the group "Org 1 Emails" (Mailing List)
  Also, three ACLs apply to Everyone, all are custom fields.
  
  As admin, I can see all above groups plus those belonging to Org 1, Org 2, Org 3, etc. on Manage Groups. 
  
  As Org 1 staff (incognito), I see only Org 1 groups in Manage Groups, but see all in CiviMail. Staff in all groups have the same experience.
Answers.UserDisplayName: Eric H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-31T07:10:28.617Z
Answers.LastActivityDate: 2015-07-31T07:10:28.617Z
Answers.UserDisplayName: cividesk
Answers.Body: <p>Similar issue is filed <a href="https://issues.civicrm.org/jira/browse/CRM-13644" rel="nofollow">here</a> for which I've submitted a PR at <a href="https://github.com/civicrm/civicrm-core/pull/6366" rel="nofollow">https://github.com/civicrm/civicrm-core/pull/6366</a></p>
  
  <p>Hope you can see Groups permitted by ACL now:)</p>
  
  <p>Update : If you can also see the groups not configured for mailing list, please upgrade to the latest CiviCRM version.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-31T18:06:52.653Z
Answers.Text: Editing those two files with your suggested fixes resolved my issue! Thank you so much. It seems to also resolve the issue with seeing the non-mailing lists. Not sure why, but who am I to ask at this point :)
Answers.UserDisplayName: Eric H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-03T08:54:49.037Z
Answers.Text: @EricH I've updated the PR as some the test were failing. I recommend you to please use the latest changes in order to avoid other conflicts. Thanks.
Answers.UserDisplayName: jitendra - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T18:18:23.170Z
Answers.Text: I have now done so. My version of api/v3/Group.php didn't match yours exactly (probably because I'm still on 4.6.3, not 4.6.5) but the code still works as intended.
Answers.UserDisplayName: Eric H
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-31T11:58:18.827Z
Answers.LastActivityDate: 2015-07-31T11:58:18.827Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>I create a new email and go to choose "Recipients". I see a full list of all groups. This includes groups I shouldn't be allowed to see (per ACL rules), and groups that do not have the "mailing list" attribute. Does a little trick exist that can restrict the groups available to choose from?</p>
  
  <p>Edit: CiviCRM version: 4.6.3</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-30T16:50:52.050Z
Comments.Text: Which Civi version? I wonder if this is a regression similar to [Basic Search form group select does not respect ACLs](https://issues.civicrm.org/jira/browse/CRM-16836).
Comments.UserDisplayName: davejenx
Tags: <civimail><email><acl>
Title: CiviMail shows unexpected groups when selecting recipients
ThreadText: # CiviMail shows unexpected groups when selecting recipients
  
  (Asked by: username_0 on 2015-07-30)
  
  I create a new email and go to choose "Recipients". I see a full list of all groups. This includes groups I shouldn't be allowed to see (per ACL rules), and groups that do not have the "mailing list" attribute. Does a little trick exist that can restrict the groups available to choose from?
  
  Edit: CiviCRM version: 4.6.3
  
  **Tags:** civimail, email, acl
  
  > **Comments:**
  > **username_1**: Which Civi version? I wonder if this is a regression similar to [Basic Search form group select does not respect ACLs](https://issues.civicrm.org/jira/browse/CRM-16836).  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-07-31. Score: 3 | Accepted answer
  
  Similar issue is filed [here](https://issues.civicrm.org/jira/browse/CRM-13644) for which I've submitted a PR at <https://github.com/civicrm/civicrm-core/pull/6366>
  
  Hope you can see Groups permitted by ACL now:)
  
  Update : If you can also see the groups not configured for mailing list, please upgrade to the latest CiviCRM version.
  
  > **Comments:**
  > **username_0**: Editing those two files with your suggested fixes resolved my issue! Thank you so much. It seems to also resolve the issue with seeing the non-mailing lists. Not sure why, but who am I to ask at this point :)  
  > **username_3**: @EricH I've updated the PR as some the test were failing. I recommend you to please use the latest changes in order to avoid other conflicts. Thanks.  
  > **username_0**: I have now done so. My version of api/v3/Group.php didn't match yours exactly (probably because I'm still on 4.6.3, not 4.6.5) but the code still works as intended.  
  
  ---
  
  ### Answer by username_2 on 2015-07-31. Score: 1
  
  Sounds like a bug to me, at least for the ACLs. I am quite surprised that you can see groups that have not been flagged as "mailing list". Can you please provide specifics on the version you are using, as well as the way you have setup these ACLs? Also, on the Manage Groups screen, do you see the same groups or a different list? Finally, do users that have different ACLs than yours have the same issue?
  
  > **Comments:**
  > **username_0**: v4.6.3  ACLs Role "Org 1 Staff" created & assigned group with the same name Role "Org 1 Staff" allowed to edit the group "Org 1 Universe" Role "Org 1 Staff" allowed to edit the group "Org 1 Staff" (Access Control) Role "Org 1 Staff" allowed to edit the group "Org 1 Emails" (Mailing List) Also, three ACLs apply to Everyone, all are custom fields.  As admin, I can see all above groups plus those belonging to Org 1, Org 2, Org 3, etc. on Manage Groups.   As Org 1 staff (incognito), I see only Org 1 groups in Manage Groups, but see all in CiviMail. Staff in all groups have the same experience.  
  
  ---
  
  