- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 04:32 AM
HI all,
when you open incident form on the top right header label there is manage attachments button(paper clip icon).
i want it to be visible only user with some particular role (like only admin can see that icon) for all others its hidden.
Pls tell me what are the ways to achieve it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2017 02:38 AM
k, then undo everything done so far.
Just write an onload client script to read the user role and if the user doesn't have the appropriate roles then just
g_form.disableAttachments();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 04:46 AM
Hi Jayanthi,
This is controlled from write ACL. If particular user is not having write acl i.e. not allowed to write then he/she won't see the icon.
If you want it to be hidden for role "abc" then create a write acl for the table and don't allow the user to write. The icon will automatically be hidden.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 05:09 AM
so what table i need to apply ACL on (incident or sys_attachment). And what are the conditions for that.
if i put ACL on sys_attachement table then the user cant add attachements for problem and change as well.(am i right ? )
if i put ACL on incident table ACL i am able to select field of incident, or incident as a whole and i didnt understand what condition i can put to stop attachemnt.
pls explain in detail. I am a bit too weak in ACL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 05:15 AM
Hi Jayanthi,
Create a write table level ACL on incident table and click the advanced check box. In the script section add this line of code
answer = !gs.hasRole("abc");
what this will do is if the user has "abc" role script will return false and user won't see attachments.
If user has any other role other than "abc" then it will show the attachment icon. But this will allow user to edit form fields unless any specific field level acl is present for the form fields which disallows this user.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 08:51 PM
hi Ankur.
i tried putting a write ACL on incident with none in fields and in advance script i wrote that piece of code u sent.
but when i tried giving a user that role and impersonated him i was able to view attachments, even rename n download them.