I want to prevent users from downloading case attachments if they are not using a specific IP addres

mochildbel2
Tera Contributor

We would like to disable the download of case attachments on the navigation page if the following conditions are met
1. the login user has a specific role
2. the logged-in user is not using a specific IP address.

We would like to know if you have any knowledge on how to implement this feature.

1 ACCEPTED SOLUTION

Simran Gadodiya
Mega Sage

Hello @mochildbel2 

The way I would suggest, is to create an read ACL on the sys_attachment table, that uses the GlideSession to define if a user should have access.
If the user login event has a corporate IP address as parm, then grant access.

Look at this useful video by Chuck Tomasi,

https://www.youtube.com/watch?v=RAgOmnru21o

 

Thanks

View solution in original post

Need something more flexible than a ServiceNow system property or user preference? A session variable may be just the thing. Join Chuck as he explores some interesting use cases for the GlideSession API. Episode topics include: * Script actions * Session variables * ACLs Code snippets shown in ...
2 REPLIES 2

Amitoj Wadhera
Kilo Sage

Hi @mochildbel2 ,

 

You can make use of the following code snipped in addition to your other condition checks.

var session = gs.getSession();
var addr = session.getClientIP();
gs.info(addr);

 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

Simran Gadodiya
Mega Sage

Hello @mochildbel2 

The way I would suggest, is to create an read ACL on the sys_attachment table, that uses the GlideSession to define if a user should have access.
If the user login event has a corporate IP address as parm, then grant access.

Look at this useful video by Chuck Tomasi,

https://www.youtube.com/watch?v=RAgOmnru21o

 

Thanks

Need something more flexible than a ServiceNow system property or user preference? A session variable may be just the thing. Join Chuck as he explores some interesting use cases for the GlideSession API. Episode topics include: * Script actions * Session variables * ACLs Code snippets shown in ...