hide/show manage attachement in incident based on user role

pushparaj
Mega Contributor

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.

1 ACCEPTED SOLUTION

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();


-Anurag

View solution in original post

19 REPLIES 19

Anurag Tripathi
Mega Patron
Mega Patron

One way is way Ankur Suggested above.



You can also control it in onload client side via client script also.


-Anurag

hi Anurag,


how to control it in on load. ?



what i have in mind is (pls correct me if i am wrong)


we can get user role from script inculde or g_scratchpad and use that value to check on on-load client script.
but is manage attachment is part of incident form or is it a UI action.


if part of form, what is the field name for that button.


Here is a more direct approach



Administering Attachments - ServiceNow Wiki



To restrict who can upload attachments:


  1. Navigate to System Properties > Security.
  2. In the Attachment limits and behavior section, locate the List of roles (comma-separated) that can create attachments: property (glide.attachment.role).
  3. Enter one or more roles separated by commas.
    Only roles listed in this property are able to upload attachments to a record. If no roles are entered, then all roles can upload attachments to ServiceNow forms.
  4. Click Save.
-Anurag

its working Nice anurag.
but now the user has no access to add attachments. But now user cant attach any attachments on problem and change as well.


And adding no_attachement attribute does not allow anyone from adding attachement on that table. can we combine no_attachment attribute with something


and make it check role as well ?
is there any incident specific approach.


Or like you were saying before do controlling it in onload Client script possible ?


hi



can you please help me out. I am still struck with this thing.