How restrict particular RITM records using ACL

ramesh_r
Mega Sage

Hi All,

 

My requirement is I need to hide particular RITM's which created from specific catalog using ACL for all user and it show visible to only specific role user

 

But the challenge is the RITM table has 5 ready ACL which is allowing all RITM records to read all the ITIL user 

 

So please guide me now what type of ACL I should create …?

1 ACCEPTED SOLUTION

Hello,

 

Please do the below:-

 

Create a read ACL on sc_req_item table:-

 

Saurav11_0-1665582320639.png

 

Then in the condition give the name of a;; the item you want to restrict:-

 

Saurav11_1-1665582368676.png

 

 

Then in the roles add the role for which you want it to show. So now those items will only be shown to those specified role users

 

Saurav11_2-1665582430281.png

 

Please mark my answer as correct based on Impact.

View solution in original post

7 REPLIES 7

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

On the RITM table create a before query BR as below:-

 

Saurav11_0-1665580664942.png

 

Then write the below script. In this you need to replace the query with your query of all the items which you want to show to a specific role and in the role just write the role name

 

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

	// Add your code here
	if(!gs.getUser().hasRole('rolenanme')){
		current.addEncodedQuery('Replacewithyourencodedquery');
	}
	
})(current, previous);

 

So for example if user does not have admin he will no see the particular catalog item script will look like below:-

 

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

	// Add your code here
	if(!gs.getUser().hasRole('admin')){
		current.addEncodedQuery('cat_item!=060f3afa3731300054b6a3549dbe5d3e');
	}
	
})(current, previous);

Please mark my answer as correct based on Impact. 

Hi Mega Sage,

 

My Requirement is need to achieve only using ACL, customer not accepting with BR

Hello,

 

Please do the below:-

 

Create a read ACL on sc_req_item table:-

 

Saurav11_0-1665582320639.png

 

Then in the condition give the name of a;; the item you want to restrict:-

 

Saurav11_1-1665582368676.png

 

 

Then in the roles add the role for which you want it to show. So now those items will only be shown to those specified role users

 

Saurav11_2-1665582430281.png

 

Please mark my answer as correct based on Impact.

Hi,

 

I just created the ACL as you mentioned but still ITIL user able to see that RITMs

Read ACL 

ramesh_r_0-1665582999040.png

 

ITIL User

 

ramesh_r_1-1665583060769.png