Business Rules for restricting access to TASKs

matt_a
Kilo Guru

I am trying to restrict access to certain SC_TASK to users of various groups and/or roles.

I have 2 scenarios that I am trying to achieve. One of which I have accomplished.

I just need to be shown what I am doing wrong and what I need to do to rectify it.

Scenario 1 – accomplished

I created a before business rule. Selected query and then completed the below:

find_real_file.png

This only allows users who are part of this customer success group the ability to see tasks that are assigned to that group. They cannot view any other task that’s assigned to another group.

Scenario 2 – failed

I want to set up a similar situation as scenario 2, but this group of people will be part of 2 assignment groups and need to see tasks assigned to only the 2 groups.

I have tried multiple attempts at this but each has failed including individual rules for each assignment group.

One of the obstacles is that one of the groups is a parent group and the other is a child of the parent. But both assignment groups have tasks assigned to them.

 My latest attempt was:

find_real_file.png

The team does have a specific role, so would a role based business rule be better?

Does anyone have some experience in this that would be able to walk me through it?

Many thanks in advance

1 ACCEPTED SOLUTION

Inactive_Us1957
Kilo Guru

Try as 

current.addEncodedQuery('assignment_group=b85d44954a3623120004689b2d5dd60a^assignment_group=09745cc9c3302200e7c7d44d81d3ae6f')

View solution in original post

7 REPLIES 7

Inactive_Us1957
Kilo Guru

Try as 

current.addEncodedQuery('assignment_group=b85d44954a3623120004689b2d5dd60a^assignment_group=09745cc9c3302200e7c7d44d81d3ae6f')

Many thanks, this has now achieved the desired affect

wcasas1
Tera Contributor

I use the condition as: gs.getSession().isInteractive() && !gs.hasRole('admin') to make sure admins have all visibility in case of issues. Then as the rule for your second scenario you can use an if statement and query like this:

if(gs.getUser().isMemberOf('GROUP1','GROUP1')){
var qc = current.addQuery('assignment_group', 'IN', 'GROUP1,GROUP2') ;}