- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 12:35 PM
Hello, I have created a UI Action that should only show for certain users. I have added a condition shown below. However if I impersonate a user who cannot create a record on the table, the button still shows. Is there a way to hide this button? it is the only button showing on the form
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:21 PM
Hi @DreDay3000,
@Vishal Jaswal was absolutely on the money re leveraging parenthesis. Another condition you may want to consider based on your feedback is "&& current.canCreate()".
This essentially checks if the user has access to create a record in the related table (or passes can create ACL).
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 12:43 PM
Hello @DreDay3000
Have all OR conditions in the paranthesis as they will be evaluated first and then && condition.
(gs.hasRole("abc_template_read") || gs.hasRole("abc_template_create") || gs.hasRole("abc_template_admin")) && current.u_state != "review"
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:05 PM
Thanks, the user I'm testing with has read and write permissions to that form but does not have create and the button still shows for that user. I have tried the condition you recommended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:11 PM
Either of two below should work for you:
(!gs.hasRole("abc_template_read") && (gs.hasRole("abc_template_create") || gs.hasRole("abc_template_admin"))) && current.u_state != "review"
(gs.hasRole("abc_template_create") || gs.hasRole("abc_template_admin")) && current.u_state != "review"
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2025 01:21 PM
Hi @DreDay3000,
@Vishal Jaswal was absolutely on the money re leveraging parenthesis. Another condition you may want to consider based on your feedback is "&& current.canCreate()".
This essentially checks if the user has access to create a record in the related table (or passes can create ACL).
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie