i created one ACL with scripting but it's won't working so please let me know my mistake

mani55
Tera Contributor

i created one Read only ACL for one table and i written below script but it's not working so please let me know my mistake

answer=true;
var ciLink=current.u_ci_link;
var gr= new GlideRecord("u_cmdb_ci_service_vmware_insta");
gr.addQuery('name',ciLink);
gr.query();
if(gr.next()){
	var grd=new GlideRecord('u_alm_service');
	if (grd.get(gr.u_itaas_asset_number))
		answer =grd.getDisplayValue('assigned_to')==gs.getUserID();
		
}
1 ACCEPTED SOLUTION

Anubhav24
Mega Sage
Mega Sage

Hi @mani55 ,

Can you try using Access Analyzer to assess your ACL if you are working on Vancouver

 

Please mark helpful/correct if my response helped you.

 

View solution in original post

14 REPLIES 14

Hi @mani55 ,

 

for ex. following 3 ACLs can be conflicting because Name , operation, type is same on all three and all are active.
Screenshot 2024-02-19 at 14.10.34.png

 

if one of the ACLs from above return true i.e. provide access to perform operation on name. the users will have access.

You can apply the same logic for the requirement you are trying to achieve.

Warm Regards ,

Shivambi

 

i checked but there is no over ride acl is there and please check below code i modified 

 
    if ((current.u_ci_link.ref_u_cmdb_ci_service_vmware_insta.u_itaas_asset_number.assigned_to+"").indexOf(gs.getUserID()) !== -1)
        return true;
    else{
        return false;
    }
   

Hi @mani55 ,

 

can you explain what are you trying to achieve and involved tables , parent tables. 
What is this ACL suppose to do ?

Warm Regards,

Shivambi

Anubhav24
Mega Sage
Mega Sage

Hi @mani55 ,

Can you try using Access Analyzer to assess your ACL if you are working on Vancouver

 

Please mark helpful/correct if my response helped you.

 

mani55
Tera Contributor

HI Anubhav,

 

i used below script but no luck

 

answer=false;
var ciLink=current.u_ci_link;
var gr= new GlideRecord("u_cmdb_ci_service_vmware_insta");
gr.addQuery('name',ciLink);
gr.query();
if(gr.next()){
	var grd=new GlideRecord('u_alm_service');
	if (grd.get(gr.u_itaas_asset_number)){
		if(grd.assigned_to == gs.getUserID()){
answer = true;
}	
}}
gs.addInfoMessage('hello i am value of answer'+answer);