How restrict row level to users

Gillerla Rajesh
Tera Contributor

Hi There,

 

Itil admin can see only inactive incident records only.

How many we can restrict records ?

I know with Before query BR and ACL

 

Any one suggest me how can I restict with ACL any sample script pls.

 

Regards

Rajesh.

8 REPLIES 8

@Gillerla Rajesh ,

You want to see only inactive records itil_admin,  So In this case your restricting the records That's not how ACL works.. You should go with query business rules, that is the right approach 

Community Alums
Not applicable

Hi @Gillerla Rajesh ,

I tried your problem in my PDI and it works for me 

Please create query Business rule on incident table and add below script 

SarthakKashyap_0-1722703382853.png

SarthakKashyap_1-1722703404653.png

In Condition 

gs.hasRole("itil");

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.addQuery("active", false);

})(current, previous);

 

Result 

When imporsonated with ITIL user 

SarthakKashyap_2-1722703476330.png

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

Hi @Community Alums 

Query BR i know, I need how with ACL

And how many ways we can control row level records

Abhay Kumar1
Giga Sage

@Gillerla Rajesh please follow this article to create row level article it's provided in servicenow doc with screen shot which you can replace with respect to your table.

https://docs.servicenow.com/bundle/utah-platform-security/page/administer/contextual-security/concep...

 

I will suggest to be more concious when create before display business rule because it also impact on other places and just think of if anybother places required those data will also be impacted due to business rule.

hope this will be useful.