I have functions in my JavaScript which I would not like to be available to normal users, and only to admins/staff. Ideally I can create a boolean variable which is true/false depending on whether the request user is staff or not, but how would I set this boolean?

Note: I'm not trying to disable them for security, but only for user experience.