Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ui macro and ACLs

tahnalos
Kilo Sage

Hello

I have a UI Macro that contains a script that is supposed to look for entries in a certain table and display them in table format in the Service Catalog.   The users that would be using this macro have a particular role.

At the same time, the security on the target table is quite strict.   To try to get around this, I had created read ACLs for table, and table.* for the same role.  

However, no matter what I do in the macro, it doesn't seem to want to search for any records.   Wondering if I should be using a different type of ACL, is there a Query ACL that I can use?

Thanks

1 ACCEPTED SOLUTION

As it turns out Macros do work well with ACLs



What DOESN'T Work well is if you use a variable that was previously unknown to be a reserved keyword.   As I found out, UI Macros interpret the "gr" variable as a global variable unlike business rules that assume that gr is local to the rule itself.



Once I changed the gr to something more distinctive (i.e. grec), the script worked as expected.
*bangs head*


View solution in original post

13 REPLIES 13

Yes, I attempted this through impersonation.   No dice when I run the Macro.


Interesting that the table already has table and table.* ACLs without any particular roles in question, nor any conditions.   The description says this was done to give all users read only access to this table.   And Yet, running a query through a macro doesn't return anything.


As it turns out Macros do work well with ACLs



What DOESN'T Work well is if you use a variable that was previously unknown to be a reserved keyword.   As I found out, UI Macros interpret the "gr" variable as a global variable unlike business rules that assume that gr is local to the rule itself.



Once I changed the gr to something more distinctive (i.e. grec), the script worked as expected.
*bangs head*


That makes sense. That's why today's business rules now default to encapsulated within a function to avoid variable scoping issues. Glad you got it figured out.