Answers.Body: <p>Unfortunately I don't think this is possible through the UI. As far as I know the ACLs for custom fields only have a combined view/edit permission - it's both, or nothing. Similarly I don't think it's possible to hide address data out of the box.</p>
  
  <p>If you wanted to stop them viewing the custom fields altogether, you could turn off their access to custom data, then create ACLs for any custom fields you <em>do</em> want them to see:</p>
  
  <ol>
  <li>Assign the users to a particular role within WordPress. By users, I mean the WordPress users - so the usernames they use to log into the website.</li>
  <li>Go to WordPress Access Control and make sure they <em>don't</em> have the 'access all custom data' permission</li>
  <li>Create a new group in Civi with the type 'Access Control'. Add the Civi record of all the above users to it (Each user login should have an associated record in Civi)</li>
  <li>Go to 'Users and Permissions' -> 'Access Control' -> 'Manage Roles' and create a new role. For example, we have 'Office users', 'Home users' etc.</li>
  <li>Go to 'Access Control' -> 'Assign Users to Roles' and assign the group from #3 to the role in #4. You could add multiple groups to this role if you wanted.</li>
  <li>Go to 'Access Control' -> 'Manage ACLs' and add an ACL. Use the role from #4, the Operation 'Edit', the type of data 'A set of custom data fields', then select the appropriate custom fields.</li>
  <li>Remember that these users will only be able to access the custom fields that you specifically allow them to on this screen. So you may need to create multiple ACLs, and create new ACLs when you create new custom fields in future.</li>
  </ol>
  
  <p>It's probably worth playing around with ACLs just to check there's no way to set a view-only permission, just in case the functionality is there but the UI hasn't caught up.</p>
  
  <p>It might be possible using <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Permission+hooks" rel="nofollow">permission hooks</a>, though - I'll leave that for someone better informed than me.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-29T21:11:08.827Z
Answers.Text: This is the correct answer.  You can write an extension/have someone write it for you.  You can also submit this to the Paid Issue Queue (https://civicrm.org/paid-issue-queue) - I think this is an excellent example of a feature that could benefit from the paid issue queue!
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-29T15:47:33.077Z
Answers.LastActivityDate: 2015-07-29T15:47:33.077Z
Answers.UserDisplayName: Andrew West
Answers.Body: <p>check out this documentation: <a href="http://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/" rel="nofollow">http://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/</a></p>
  
  <p>If you want to restrict edit privileges of standard address field, you might have to set the fields in a profile</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-29T21:09:50.030Z
Answers.Text: Unfortunately, this doesn't solve the problem, because of this in-UI warning: NOTE: For Custom Data ACLs, the 'View' and 'Edit' operations currently do the same thing. Either option grants the right to view AND / OR edit custom data fields (in all groups, or in a specific custom data group). Neither option grants access to administration of custom data fields.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-29T13:37:31.667Z
Answers.LastActivityDate: 2015-07-29T13:37:31.667Z
Answers.UserDisplayName: Kboy
Answers.Body: <p>There is a pull request which enables ACLs for custom fields to respect View only permission: <a href="https://github.com/civicrm/civicrm-core/pull/15347" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/15347</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-19T15:45:09.320Z
Answers.LastActivityDate: 2020-11-19T15:45:09.320Z
Answers.UserDisplayName: Darren
Body: <p>I am trying to restrict a set of users to edit specific fields. The fields I want to restrict are all custom fields (but it would also be useful to restrict edit privileges on standard address fields).</p>
  
  <p>I am going round in circles on Wordpress user accounts/permissions, ACL roles, profiles, groups etc.  </p>
  
  <p>So essentially i want some fields editable, others view only. </p>
  
Tags: <permissions>
Title: How can I restrict a users ability to edit a custom field
ThreadText: # How can I restrict a users ability to edit a custom field
  
  (Asked by: username_0 on 2015-07-29)
  
  I am trying to restrict a set of users to edit specific fields. The fields I want to restrict are all custom fields (but it would also be useful to restrict edit privileges on standard address fields).
  
  I am going round in circles on Wordpress user accounts/permissions, ACL roles, profiles, groups etc.
  
  So essentially i want some fields editable, others view only.
  
  **Tags:** permissions
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2015-07-29. Score: 4
  
  Unfortunately I don't think this is possible through the UI. As far as I know the ACLs for custom fields only have a combined view/edit permission - it's both, or nothing. Similarly I don't think it's possible to hide address data out of the box.
  
  If you wanted to stop them viewing the custom fields altogether, you could turn off their access to custom data, then create ACLs for any custom fields you *do* want them to see:
  
  1. Assign the users to a particular role within WordPress. By users, I mean the WordPress users - so the usernames they use to log into the website.
  2. Go to WordPress Access Control and make sure they *don't* have the 'access all custom data' permission
  3. Create a new group in Civi with the type 'Access Control'. Add the Civi record of all the above users to it (Each user login should have an associated record in Civi)
  4. Go to 'Users and Permissions' -> 'Access Control' -> 'Manage Roles' and create a new role. For example, we have 'Office users', 'Home users' etc.
  5. Go to 'Access Control' -> 'Assign Users to Roles' and assign the group from #3 to the role in #4. You could add multiple groups to this role if you wanted.
  6. Go to 'Access Control' -> 'Manage ACLs' and add an ACL. Use the role from #4, the Operation 'Edit', the type of data 'A set of custom data fields', then select the appropriate custom fields.
  7. Remember that these users will only be able to access the custom fields that you specifically allow them to on this screen. So you may need to create multiple ACLs, and create new ACLs when you create new custom fields in future.
  
  It's probably worth playing around with ACLs just to check there's no way to set a view-only permission, just in case the functionality is there but the UI hasn't caught up.
  
  It might be possible using [permission hooks](http://wiki.civicrm.org/confluence/display/CRMDOC/Permission+hooks), though - I'll leave that for someone better informed than me.
  
  > **Comments:**
  > **username_2**: This is the correct answer.  You can write an extension/have someone write it for you.  You can also submit this to the Paid Issue Queue (https://civicrm.org/paid-issue-queue) - I think this is an excellent example of a feature that could benefit from the paid issue queue!  
  
  ---
  
  ### Answer by username_3 on 2015-07-29. Score: 0
  
  check out this documentation: <http://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/>
  
  If you want to restrict edit privileges of standard address field, you might have to set the fields in a profile
  
  > **Comments:**
  > **username_2**: Unfortunately, this doesn't solve the problem, because of this in-UI warning: NOTE: For Custom Data ACLs, the 'View' and 'Edit' operations currently do the same thing. Either option grants the right to view AND / OR edit custom data fields (in all groups, or in a specific custom data group). Neither option grants access to administration of custom data fields.  
  
  ---
  
  ### Answer by username_4 on 2020-11-19. Score: 0
  
  There is a pull request which enables ACLs for custom fields to respect View only permission: <https://github.com/civicrm/civicrm-core/pull/15347>
  
  
  ---
  
  