Use ACL to hide Variable editor

emaasalmi
Kilo Sage

Is there a way to hide Variable editor from RITM form using ACL? I've found a few topics about hiding the variables on the UI side (for example This), but nothing on ACL. I know the Variable editor is a formatter, so the "normal" way doesn't work.

The requirement is to display a few fields for all itil users, but all the rest are only visible if the current user is a part of a group which has been given access. This means that I can't create the ACL's on the table level.

1 ACCEPTED SOLUTION

emaasalmi
Kilo Sage

Thanks for all your answers. You confirmed what I had already thought.

I went with a different route and modified the "com_glideapp_servicecatalog_veditor" UI Macro with a condition. Now, if the same conditions that are used in the ACL's don't match, the Variable editor won't fetch the Variables to the formatter in the first place.

View solution in original post

7 REPLIES 7

Suseela Peddise
Kilo Sage

Hi,

You can write client script to hide/visible variables on RITM. Below is the example code to hide/display variable on RITM/catalog task variable editor based on the role.

You can tweak the code according to your requirement.

 

find_real_file.png

 

Hope this helps!

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Suseela P.

Willem
Giga Sage
Giga Sage

Hi,

Formatters cannot be hidden via ACL's because formatters are merely a graphical display of information. Basically meaning it is only formatting data it gets elsewhere.

It is not a column you can secure with an ACL.

https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/form-administrati...

 

So your only option is to use what you already found to hide it on the Client side.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot hide it using ACLs.

The variables can be shown/hidden based on condition you want using UI policies or client scripts

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Willem
Giga Sage
Giga Sage

In addition. You can set a Business rule that checks before the record is saved if the variables are changed.

This and the client side of things can be found here:

https://www.servicenowguru.com/scripting/business-rules-scripting/variables-form-readonly/