Hide menu item (portal) to Specific Users

Rairai31
Giga Guru

Hi All,

 

How to hide this widget to specific users. From the customer_contact table, only users with no value on the LDAP server field should be able to access the menu item.

 

Restriction via role is not an option because some users, for example, have snc_internal role but have LDAP server value.  Thank you.

Rairai31_0-1691650907835.png

 

1 ACCEPTED SOLUTION

Yes, to call a Script Include in your condition field you need to write below in your Condition field:

 

new getLDAP().getValue();

 

  1. You don't need to write javascript before above statement as it is already evaluated as JS.
  2. getLDAP() is the name of script inculde. You can change it to whatever your script include name is.
  3. getValue() is the function that you will create inside the Script Include.

 

Again, if my answer helps then please mark it Helpful or Correct!

 

Thanks,

Utpal

 

View solution in original post

7 REPLIES 7

Your hasAccess() method has a parameter in Script Include but you are not passing any parameter when you're calling this function in condition field. I think you want to pass logged in user sys_id here and to do that you need to write hasAccess(gs.getUserID();

Also, your return statement of SI is wrong. You should return a string value always!

Hi @Utpal Dutta, I was able to make it work. I appreciate your assistance. Thank you very much.

@Rairai31 

Please mark my answer Helpful & Correct so that it helps other community members to find correct answers of the related issue.

 

Thanks,

Utpal