The Zurich release has arrived! Interested in new features and functionalities? Click here for more

attachment restrict to a particular user in a table

jishnu_36
Tera Expert

i have requirement had a field of assigned to in a table the particular user only access the attached files in sys_attachment table can any one help me pls.. thankyou   

6 REPLIES 6

PrashantLearnIT
Giga Sage

Hi @jishnu_36 

 

You can write an access control on attachments table for this type of requirements.

 

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

can  you pls explain in detail like I'm trying to create acl as well but my requirement was particular user can only access the manage attachment . pls can you have a look my query. 

can any one explain with script include and  my actual requirement was hide the manage attachment button on form for all users expect assigned to users its able to visible

thanks in advance

piyushsain
Tera Guru
Tera Guru

Hi @jishnu_36 

You can create a read acl on the sys_attachment table and in conditions add the table name. write the script below

 

var recgr = new GlideRecord('table_name');
recgr.get(current.table_sys_id);

if(recgr.assigned_to == gs.getUserID())
return true;

else
return false;

if there are other read acl on sys_attachment table then in each of them you have add a condition that table name is not the table you want to apply the above acl

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain