New and Edit UI Action Visibility on Related List

Anubhav24
Mega Sage
Mega Sage

Hi All,

For the catalog tasks related list on sc_req_item , I want to show New button based on role, I have created a new role and when I am trying with a user which is non-admin the New button is visible if the user has the specific role and if the user does not have specific role the New button is not visible but if a user is admin the button is visible always even though the admin user does not have that role.

Note : The Omit new button is unchecked and Omit New condition is empty , I am just trying with roles assigned.

Any leads on this would be appreciated.

Please see attached screenshot:

AnubhavSrivas2_0-1677053484361.png

@Ankur Bawiskar @SatyakiBose 

8 REPLIES 8

Hi ,

Thanks a lot for your reply , so as I understand if the button is made visible admin user would be able to see it if the visibility is controlled through roles (Can you please confirm this). And we are not going on the path of creating a custom UI Action and we are targeting to use the OOB functionality.

Hello @Anubhav24 

Thats correct.

Admin users will always be able to override any restrictions based on role (unless explicitly mentioned in thhe conditions).

Anubhav24
Mega Sage
Mega Sage

Hi,

I have a small doubt regarding this , so I created a new user with itil role and assigned the required role to see the New button and this new user is able to see the New button on the related list , but if I do the same with other non-admin users , these users even though they have the required role are unable to see this New button , is itil role required to along with the specified role to see this New button.

@Ankur Bawiskar @SatyakiBose 

Hello @Anubhav24 

You should also see the condition that is specified in the UI action.

In my previous update, I mentioned the UI action that was being called.

The condition set is : 

current.canCreate() && !RP.getListControl().isOmitNewButton() && RP.isRelatedList() && !RP.isManyToMany() && !RP.isInDevStudio()

Since this condition not is satisfying for the current (non-admin) user, the UI action is not visible.

You can validate it with another method as well.

  • Since the condition talks about - current.canCreate(), see if the non-admin users can access the sc_task table directly, and create a new record in the table.
  • If not, then the users do not have access to create records in the table, and therefore the new button is not visible even if you add the role in list control.
  • OOB we have an ACK which only allows itil & sn_request_write users to write on the sc_task table.
    SatyakiBose_0-1677139180899.png

     


    You need to bypass this ACL.