Hi, Conditions for hiding UI actions from End users

kurella swamy
Tera Contributor

Hello Everyone,

 

I'm looking for guidance on configuring UI actions so that the UI actions should not visible for end users or users without any roles. What are the required conditions to ensure that UI action are hidden from end users?

 

Thanks in advance

18 REPLIES 18

@kurella swamy 

 

Yes it is definitely possible when you know the defined set of roles or User Criteria for END USERS. But it is not suggested as users with any role other than the mentioned END USER role will be able to access the UI Action which will be nightmare for you later. Better use the hasRole rather than !hasRole. This will ease things for you.

@Ravi Peddineni  Thank you so much for your valuable insights . I will the same as gs.has format

Sajilal
Mega Sage

if you mean end users are using without any role, that means they are self service users? if yes they see the self service view. So make use of UI Action visibility in your UI action to hide the same from your end Users instead of any customizations!

 

https://docs.servicenow.com/bundle/xanadu-platform-administration/page/administer/list-administratio... 

 

If this was helpful, do give a thumbs up/mark it as Correct to close the Thread, Thanks

Fevzi Yerlikaya
Tera Contributor

You can use the g_user.hasRole() function in the UI action conditions. Just set it so that only users with specific roles can see the action. For example, if you want to hide it from everyone except admins, you could use a condition like !g_user.hasRole('admin').