How to restrict incidents visible based on user role in service now?

Upendar4
Tera Contributor

if the incident state field value is resolved then that records only visible for particular users based on the role.

can anyone please help me with this...

thanks,

upendar

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

You can control this via ACL and Before Query business rule.

For the before query business rule you can use something like:

if (!gs.hasRole('admin')) {
current.addQuery('state', '!=', 3);
}

The above example would filter out any incident where the state is 3 if they're not an admin.

The same can be done for "read" ACL on this table, by adding appropriate role to the ACL and then adding condition 'state' 'is not' 'x', where x represents what state you're trying to filter out.

You must ensure that the same user doesn't pass any other "read" ACL on that table as well else they'll see more records.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

5 REPLIES 5

Tony K
Kilo Sage
Kilo Sage

I personally like the query business rule, easier to configure and test than messing with an ACL.

This example condition has both a role and member of a specific group requirement. 

find_real_file.png