Logic Machine Forum
how to hide/show an object depending on the user - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: how to hide/show an object depending on the user (/showthread.php?tid=4213)



how to hide/show an object depending on the user - gdimaria - 04.09.2022

Hi!
how to hide/show an object depending on the logged user?

Thanks

Peppe


RE: how to hide/show an object depending on the user - admin - 05.09.2022

This example will hide all elements with hide-normal-user class for non-admin users.
Code:
$(function() {
  if (window.Globals && Globals.user != 'admin') {
    $('.hide-normal-user').addClass('hide');
  }
});



RE: how to hide/show an object depending on the user - gdimaria - 05.09.2022

(05.09.2022, 06:37)admin Wrote: This example will hide all elements with hide-normal-user class for non-admin users.
Code:
$(function() {
  if (window.Globals && Globals.user != 'admin') {
    $('.hide-normal-user').addClass('hide');
  }
});

Thanks a lot!!!

Peppe