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

Utpal Dutta
Tera Guru

Hi there,

Why don't you use conditions filed which is available on menu item form. This condition is evaluated on server so if your logic is complex you can always write a Script Include and call it in the Conditions field available on menu item form.

 

UtpalDutta_0-1691653329875.png

 

 

Note: Don't forget to use (javascript:) before calling your script include.

 

If my answer helps then please mark it Helpful or Correct!

 

Thanks,

Utpal

Hi @Utpal Dutta, I am planning to create a script include. Could you please show me a sample, what do you mean by (javascript:). I am still learning scripting. Thank you.

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

 

Hi @Utpal Dutta, I have created this script include 

Rairai31_0-1691658278803.png

and put the condition in the menu item but still restricted users are still able to view the menu item. 

Rairai31_1-1691658379940.png

Thank you.