Make a checkbox editable (can be checked by) only a single group of people.

omsa1
Kilo Guru

Hi there,

I have a requirement where only single group of people should able to check the checkbox and should read only to others. How can i do this?

1 ACCEPTED SOLUTION

If the field is set to Read Only in the dictionary, then it will be read


only everywhere in the UI, and can only be programmatically updated.



Read only fields are best used when they are calculated or updated in some


way that isn't manual.



Make it not read only and your ACL will take over.



On Tue, Dec 20, 2016, 6:04 PM omsarah <community-no-reply@servicenow.com>


View solution in original post

8 REPLIES 8

Patrick Schult2
Giga Guru

Checking group membership from the client is tricky and not included with the base system. You could use Access Controls to have the server control whether or not you can write to the true/false field in question.



See Access control rules for details on how that works.



For a real example, say there is a checkbox called "Needs followup" on the Incident [incident] table, and you wanted to control who can write to it by group membership. You could secure it with an ACL like the following.



Operation: write


Table: Incident


Field: Needs followup


answer = (gs.getUser().isMemberOf('somegroupsys_id'));



Alternatively, you could use the Role related list on the ACL form and define a bona-fide role that the user must have in order to write to the field. You would then grant this role to the group(s) in question. They accomplish the same thing, it's just another way of doing it. Using a role has other benefits - like not having to write a script, and being able to re-use that role for other purposes later on.


Hi Patrick,



I've added ACL as below but the field still showing read only also for the members in PIR group. Is it because of the field set to read only?



find_real_file.png



find_real_file.png


find_real_file.png





If the field is set to Read Only in the dictionary, then it will be read


only everywhere in the UI, and can only be programmatically updated.



Read only fields are best used when they are calculated or updated in some


way that isn't manual.



Make it not read only and your ACL will take over.



On Tue, Dec 20, 2016, 6:04 PM omsarah <community-no-reply@servicenow.com>


Hi Patrick,



Thank you so much, I've unchecked the read only in dictionary and its working as it suppose to.



Sara