Create a query business rule to hide all events from 'ABC' Source, only visible to a Group and admin

Keerthan S
Tera Contributor

By using before query Business Rule
I need to hide all the Events(em_event.list), if the Source = ABC.

This should be only visible to users with a particular group(ex: TestGroup1) and admin role.

 

I tried various methods, but couldnot able to hide the Events of the 'ABC' source.

If anyone has idea please share it.

 

3 REPLIES 3

Animesh Das2
Mega Sage
Mega Sage

Hi @Keerthan S ,

 

You can write the before Query BR on 'em_event' as you are looking for, and under 'Advanced' tab use a script like below,

 

(function executeRule(current, previous /*null when async*/) {
    if ((!gs.hasRole('admin') && (!gs.getUser.isMemberOf('TestGroup1'))){
        current.addQuery(<current.source field name>, '!=',  'ABC');
    }
})(current, previous);
 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das

Keerthan S
Tera Contributor

Similarly to Create a ACL to hide all the events from 'CDE' source. It should be only visible to particular group and admin.

I need to hide all the Events(em_event.list), if the Source = CDE.

This should be only visible to users with a particular group(ex: TestGroup1) and admin role.


Could you suggest any solution


Hi @Keerthan S ,

Yes, you can create a 'Record' type 'Read' ACL on 'em_event' as below,

1. Put condition as 'source' field is 'CDE'. PFB sample SS.

AnimeshDas2_0-1727979320374.png

 

2. Under 'Security attribute condition' section, 'HasAdminRole' is 'true' AND (or OR, per your need) 'Group' is 'TestGroup1'. PFB Sample SS for your reference.

Security attribute condition --> section is introduced in Vancouver and a very useful one.

AnimeshDas2_1-1727979374240.png

 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You can mark multiple responses as correct by clicking on Accept as Solution.

You may mark this helpful as well if it helps you.

 

Thanks, 

Animesh Das