How to check if the user is a staff

I want to check if the user is a staff member before performing an action for my theme component. Is there a way that I can do that in JS?

1 Like

You need something like this:

    var isStaff = () => {
      const thisUser = Discourse.User.current(); 
      return thisUser.admin || thisUser.moderator
    }
    console.log(isStaff());
9 Likes