- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 12:11 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 01:41 AM
Yes, to call a Script Include in your condition field you need to write below in your Condition field:
new getLDAP().getValue();
- You don't need to write javascript before above statement as it is already evaluated as JS.
- getLDAP() is the name of script inculde. You can change it to whatever your script include name is.
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 12:42 AM - edited 08-10-2023 12:43 AM
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 01:29 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 01:41 AM
Yes, to call a Script Include in your condition field you need to write below in your Condition field:
new getLDAP().getValue();
- You don't need to write javascript before above statement as it is already evaluated as JS.
- getLDAP() is the name of script inculde. You can change it to whatever your script include name is.
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 02:07 AM
Hi @Utpal Dutta, I have created this script include
and put the condition in the menu item but still restricted users are still able to view the menu item.
Thank you.