This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

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

Thanks

Peppe
Reply
#2
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');
  }
});
Reply
#3
(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
Reply


Forum Jump: