restrict visibility for tickets in an assignment group for only 1 catalog item.

Chetan Kumar
Tera Contributor

My Requirement : Only the assignment group members should be able to view the tickets

What are the different ways to perform this action.

 

8 REPLIES 8

Mahendra RC
Mega Sage

Hello David,

I would suggest the best option to implement this requirement is by using the read ACL on your respective table.

You can create a read ACL and using the below script to only allow the user to see the incident only if they are the member of Assignment group.

this script will allow the access to user if user is the caller of the incident Or if the user is member of Incident's Assignment group. You can select Admin overrides checkbox so that Admin user have access on all the records.

if (gs.getUserID() == current.getValue("caller_id")) {
answer = true;
} else if (gs.getUser().isMemberOf(current.getValue("assignment_group")) && current.getValue("assignment_group")) {
answer = true;
} else {
answer = false;
}

I believe it will be difficult to use Query BR in your case because it will be difficult to add an additional query with your case. Also, If you use Query business rule the the query business rule will run every time you query that table. So there may be a cause where you want to fetch the ticket data even if the user is not a member of assignment group like in Script includes or somewhere else and in that case as well the Query BR will run. But again it depends totally on your requirement what you want to use.

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

Hello David,

Just wanted to check with you, if the my above response answered your question. If yes, then please do close this thread/question by marking the appropriate response as correct. It will be helpful for the users who have similar question in future.

If you still need any further help or guidance on this then please update those on this question.

Thanks

Below ACL is not correct, Can you please help     
ACL : 
if (gs.getUser().isMemberOf(current.getValue("assignment_group"))) {
    answer = true;
} ( i am present in Database but not in other, But it should show nothing ... Its showing missing values )find_real_file.png

Even this code works the same 

if (gs.getUserID() == current.getValue("caller_id")) {
answer = true;
} else if (gs.getUser().isMemberOf(current.getValue("assignment_group")) && current.getValue("assignment_group")) {
answer = true;
} else {
answer = false;
}