How to hide records using ACL's

Sironi
Kilo Sage

Hi All,

Could you please help me on ACL's 

Hide "Leaders" group incident records if logged in user is not a member and rest of all incidents should be visible in normal .

"Leaders" group members should be see all incidents with out restrictions 

1 ACCEPTED SOLUTION

Try below

var information_security = gs.getProperty('security_inc_assignment_group_UITSIS'); // sys_id of "UITS Information Security" group
var iso_Leaders = gs.getProperty('security_inc_assignment_group_UITSIL'); //sys_id of "UITS ISO Leadership" group

if (gs.getUser().isMemberOf(information_security) || gs.getUser().isMemberOf(iso_Leaders)) {
    //gs.addInfoMessage(gs.getMessage("Looged in user id is a Member in Security Groups"));
    answer = true;

} 
else if(gs.getUserID==current.caller_id)
answer=true;
else {
    // gs.addInfoMessage(gs.getMessage("Looged in user id not Member in Security Groups"));
    if ((current.assignment_group == information_security || current.assignment_group == iso_Leaders)&& current.caller_id!=gs.getUserID()) {
        answer = false;
    } else  {
		
        answer = true;
    }
}

View solution in original post

18 REPLIES 18

Hi Upender,

 

it is working super.

Can show records to logged in users if  caller_id 's is Logged in users.

 

Try below

if (gs.getUserID()==current.caller_id && (gs.getUser().isMemberOf('11a5a0a407123010b9aaf03c7c1ed0d8')|| gs.getUser().isMemberOf('7c452c2407123010b9aaf03c7c1ed0b7'))) {
 gs.addInfoMessage(gs.getMessage("Looged in user id is a Member in Security Groups"));
  answer = true;
   
} else {
     gs.addInfoMessage(gs.getMessage("Looged in user id not Member in Security Groups"));
    if (current.assignment_group == '7c452c2407123010b9aaf03c7c1ed0b7' || current.assignment_group == '11a5a0a407123010b9aaf03c7c1ed0d8') {
        answer = false;
    } else {
        answer = true;
    }
}

Hi Upender,

Kindly be with me for sometime here 

can we use script like below?

1. security group incidents can able to see by their security group members 

2..apart of security group inc's all user must be able to all group incidents .

above two points already achieved.

need help on 3rd point.

3.logged in user =Caller_id are same on INC? then he must his own record without any restriction, what ever that assignment group. either security group Or other group anything may be. must see his own INC.

 

var information_security = gs.getProperty('security_inc_assignment_group_UITSIS'); // sys_id of "UITS Information Security" group
var iso_Leaders = gs.getProperty('security_inc_assignment_group_UITSIL'); //sys_id of "UITS ISO Leadership" group

if (gs.getUser().isMemberOf(information_security) || gs.getUser().isMemberOf(iso_Leaders)) {
    //gs.addInfoMessage(gs.getMessage("Looged in user id is a Member in Security Groups"));
    answer = true;

} else {
    // gs.addInfoMessage(gs.getMessage("Looged in user id not Member in Security Groups"));
    if ((current.assignment_group == information_security || current.assignment_group == iso_Leaders)&& current.caller_id!=gs.getUserID()) {
        answer = false;
    } else  {
		
        answer = true;
    }
}

Try below

var information_security = gs.getProperty('security_inc_assignment_group_UITSIS'); // sys_id of "UITS Information Security" group
var iso_Leaders = gs.getProperty('security_inc_assignment_group_UITSIL'); //sys_id of "UITS ISO Leadership" group

if (gs.getUser().isMemberOf(information_security) || gs.getUser().isMemberOf(iso_Leaders)) {
    //gs.addInfoMessage(gs.getMessage("Looged in user id is a Member in Security Groups"));
    answer = true;

} 
else if(gs.getUserID==current.caller_id)
answer=true;
else {
    // gs.addInfoMessage(gs.getMessage("Looged in user id not Member in Security Groups"));
    if ((current.assignment_group == information_security || current.assignment_group == iso_Leaders)&& current.caller_id!=gs.getUserID()) {
        answer = false;
    } else  {
		
        answer = true;
    }
}

Hi Upender,

Kindly help me for understanding about Bold one.

what we are checking here ?

 


if (gs.getUser().isMemberOf('7c452c2407123010b9aaf03c7c1ed0b7') || gs.getUser().isMemberOf('11a5a0a407123010b9aaf03c7c1ed0d8')) {
answer = true;
} else if (gs.getUserID == current.caller_id) {
answer = true;
} else {
if ((current.assignment_group == '7c452c2407123010b9aaf03c7c1ed0b7' || current.assignment_group == '11a5a0a407123010b9aaf03c7c1ed0d8') && current.caller_id != gs.getUserID()) {
answer = false;
} else {

answer = true;
}
}