How to hide More options and Additional actions on form header for all users except admins

rewanthrr
Tera Expert

Hi,

I have a requirement to hide 'More options' and 'Additional actions' on the form header for all the logged in users who doesn't have Admin role.

Please find the attachment for the same.

Please help me in resolving this.

Regards,

RRR

8 REPLIES 8

Abhinay Erra
Giga Sage

Rewanth,



  There is no direct way for this. If you want the buttons to be hidden on all the forms,   create a UI script and check the global check box and copy this script in there


addLoadEvent(hideCrumbs);


function hideCrumbs(){


  try{


  if(!g_user.hasRole("admin")){


  $$('button.navbar-btn').each(Element.hide);


  }


  }


  catch(e){


  alert(e);


  }


}


Try this and let me know if this fits to your requirements.


Thanks, that helped tremendously. Usually would have done this through CSS since I only wanted to hide in the portals, but it looks like the style is coded very late in a js script with an !important after style sheets are applied, so there really doesn't look like there is any other way to override. Tried the highest specificity with an !important in override sheet which didn't work.


Chuck Tomasi
Tera Patron

Hi Rewanth,



First, thank you for the screen shot! Very helpful!



Can you provide a use case or business justification for trying to hide two basic components of the form?



I recommend against trying to change 'Additional Actions' for all users. It is the means by which they interact with the form or list menu, for example Saving the record and staying on the page. By removing them (especially for your fulfillers) you decrease their effectiveness with the software.



FYI - Using a UI script, as Abhinay, suggests, carries with it risk of not working in future releases.


rewanthrr
Tera Expert

HI Chuck,



In 'My profile' module none of the users should be able to update/save the data and we want the header to be clean. Only Admin should be able to see 'Additional actions' and 'More options'



Regards,


RRR