Restrict selections in a dropdown choice field based on role

luke_paine
Kilo Contributor

Hi folks,

I'm trying to find out if i can restrict user access to a specific choice on a dropdown field based on role.

As part of my Change form, there is s section for close code (u_close_code) which is a preset number of selections.   I need to restrict one of the close code selections to all but users in the change_managers user group.

I'm not sure if its the right way to go about it, so far I have been attempting to do this by amending the existing ACL for the sys_choice table with a condition that the sys ID is not the ID of the selection i want restricted, and have created a new ACL rule with unrestricted table access for users with the change_managers role.   Needless to say, this hasn't worked.

I have run security debug for an itil user in the change form, but this is only showing logging around access the u_close_code field.

Can this be done, and if so am i on the right track or do i need to look elsewhere?

Regards,

Luke P.

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Use on load client script and make use of g_form.removeOption method to remove the choices as per your need.





Refer this section '4.8.8 Remove an option from a choice list'


http://wiki.servicenow.com/index.php?title=Client_Scripts#What_are_some_of_the_available_helper_func...


View solution in original post

8 REPLIES 8

Kalaiarasan Pus
Giga Sage

Use on load client script and make use of g_form.removeOption method to remove the choices as per your need.





Refer this section '4.8.8 Remove an option from a choice list'


http://wiki.servicenow.com/index.php?title=Client_Scripts#What_are_some_of_the_available_helper_func...


Hmmm. I was thinking the same as you. But then I'm wondering. Wouldn't it be better with a "display business rule" just to avoid client scripts if possible?


You can't remove the options using a business rule


Ahh yea.. g_form.. darn