Answers.Body: <p>Seems like CiviCRM ACL might be your answer.</p>
  
  <p><a href="https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/" rel="nofollow noreferrer">https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/</a></p>
  
  <p>Native CiviCRM ACLs give more fine grained control, so, for example, you can limit access to view, edit, create, delete and search to :</p>
  
  <pre><code>groups of contacts
  a profile (this is a collection of existing and/or custom fields, see "Profiles")
  a set of custom fields
  events (e.g. a user may access one event, but not others)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-19T22:06:56.120Z
Answers.Text: I already use that to grant permissions to groups of contacts, but in this case the group of contacts will all have the same permissions,k but we need to restrict them even further so one member of that group can't see the same data another member of it can see.
Answers.UserDisplayName: fdarn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-19T22:09:11.880Z
Answers.Text: We want the volunteer in Florida to only see contacts with Florida addresses and the volunteer in California to only see contacts with California addresses.
Answers.UserDisplayName: fdarn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-20T00:55:45.647Z
Answers.Text: So make a role for each state, and a smart group for each state (addresses), add an ACL that each role can only access contacts from their state smart group, and then assign your volunteer the role. this way that user can only see contacts from that smart group, which is limited to addresses in a state.
Answers.UserDisplayName: Zachary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-21T15:06:32.253Z
Answers.Text: I created a new ACL Role "Connecticut Volunteers".  I assigned that role to a new group.  I added one user to that new group. This user is not in any other groups.  Then I set that Connecticut Volunteers role to view only data in the Connecticut Contacts group.  After saving it, this user still has access to ALL groups, not just the Connecticut contacts group.
Answers.UserDisplayName: fdarn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-21T19:46:47.640Z
Answers.Text: fdarn; I just made a test site and verified it worked. Can you ensure that in 'Assign Users' the group selected contains the user that will login, and verify that in 'Manage ACL' the group selected is a smart group that was made to only include addresses from Connecticut (via Advanced search or otherwise). Could you lastly ensure that in your CMS permissions you do not have 'View all Contacts' or 'Edit all Contacts' assigned to the role of the user logging in?
Answers.UserDisplayName: Zachary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-19T19:59:12.130Z
Answers.LastActivityDate: 2019-08-19T19:59:12.130Z
Answers.UserDisplayName: Zachary
Answers.Body: <p>If the standard ACL's are not sufficient, you can add your own using <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_aclWhereClause/" rel="nofollow noreferrer">hook_civicrm_aclWhereClause</a>.  Basically, you add more SQL "where" clauses to restrict which contacts are accessible. See the documentation for an example.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-20T08:38:05.020Z
Answers.LastActivityDate: 2019-08-20T08:38:05.020Z
Answers.UserDisplayName: Aidan
Body: <p>We are using Civi 5.14 on WordPress 5.1
  My client has giving me this request.  Can this even be done with Civi?  She wants to restrict our volunteers to viewing only contacts within their own state, or reports based on contacts in their own state.  Her request is below. </p>
  
  <p><strong><em>"create log-ins for almost everyone on the affiliates list (Contact/Advocate/Affiliate leader anyway.) Then, arrange so that their access gives them the ability to view ONLY contacts from their state, and have a simple way to download contact info (perhaps several pre-created reports like email/phone only, full mailing info, and "full info" which would hit a few other things like Y/N donor, member, event participation."</em></strong></p>
  
Tags: <contacts><reports><user-account>
Title: Restrict users to viewing only data in their state?
ThreadText: # Restrict users to viewing only data in their state?
  
  (Asked by: username_0 on 2019-08-19)
  
  We are using Civi 5.14 on WordPress 5.1
  My client has giving me this request. Can this even be done with Civi? She wants to restrict our volunteers to viewing only contacts within their own state, or reports based on contacts in their own state. Her request is below.
  
  ***"create log-ins for almost everyone on the affiliates list (Contact/Advocate/Affiliate leader anyway.) Then, arrange so that their access gives them the ability to view ONLY contacts from their state, and have a simple way to download contact info (perhaps several pre-created reports like email/phone only, full mailing info, and "full info" which would hit a few other things like Y/N donor, member, event participation."***
  
  **Tags:** contacts, reports, user-account
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-08-19. Score: 2
  
  Seems like CiviCRM ACL might be your answer.
  
  <https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/>
  
  Native CiviCRM ACLs give more fine grained control, so, for example, you can limit access to view, edit, create, delete and search to :
  
  ```
  groups of contacts
  a profile (this is a collection of existing and/or custom fields, see "Profiles")
  a set of custom fields
  events (e.g. a user may access one event, but not others)
  
  ```
  
  > **Comments:**
  > **username_0**: I already use that to grant permissions to groups of contacts, but in this case the group of contacts will all have the same permissions,k but we need to restrict them even further so one member of that group can't see the same data another member of it can see.  
  > **username_0**: We want the volunteer in Florida to only see contacts with Florida addresses and the volunteer in California to only see contacts with California addresses.  
  > **username_1**: So make a role for each state, and a smart group for each state (addresses), add an ACL that each role can only access contacts from their state smart group, and then assign your volunteer the role. this way that user can only see contacts from that smart group, which is limited to addresses in a state.  
  > **username_0**: I created a new ACL Role "Connecticut Volunteers".  I assigned that role to a new group.  I added one user to that new group. This user is not in any other groups.  Then I set that Connecticut Volunteers role to view only data in the Connecticut Contacts group.  After saving it, this user still has access to ALL groups, not just the Connecticut contacts group.  
  > **username_1**: username_0; I just made a test site and verified it worked. Can you ensure that in 'Assign Users' the group selected contains the user that will login, and verify that in 'Manage ACL' the group selected is a smart group that was made to only include addresses from Connecticut (via Advanced search or otherwise). Could you lastly ensure that in your CMS permissions you do not have 'View all Contacts' or 'Edit all Contacts' assigned to the role of the user logging in?  
  
  ---
  
  ### Answer by username_2 on 2019-08-20. Score: 1
  
  If the standard ACL's are not sufficient, you can add your own using [hook\_civicrm\_aclWhereClause](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_aclWhereClause/). Basically, you add more SQL "where" clauses to restrict which contacts are accessible. See the documentation for an example.
  
  
  ---
  
  