Creating a component to staff-limit user status

@Lilly If you are interested, you might try this component GitHub - Arkshine/discourse-restrict-user-status: A theme component to restrict user status access to groups.

EDIT: as soon it’s fully working, I will create a topic in theme-component .

6 Likes

Great job @Arkshine :smiley:

4 Likes

thanks. i tried it a few times and that component still won’t restrict access. for example i restricted it to admins (me) and my test user account could access the user status functions.

update: I’ve since tried and failed with Staff and Moderator groups as well. it’s as if the component isn’t enabled but it certainly is. :thinking:

Make sure you have the latest version, if not already.

Also, from what I see on your forum, enable_user_status is disabled. :thinking:

1 Like

yea i disabled it after i couldn’t get it to work. i will work on it later when i get back to my desk. i really don’t want my users getting a hold of it lol.

Alright :smile:.

It’s definitively working for me. The only issue I can think of is you may have kept the ‘everyone’ group in the setting (as it’s the default value, I should probably remove it :thinking: )

1 Like

i’ve tried a few times now with no luck. admin is the only group in the allowed group setting. i have to keep turning the user status setting on and off to test it so maybe that is why. i have it off right now.

in other words i am able to turn it off globally in the admin settings for user_status but the component doesn’t appear to have any effect regardless of what group i use i the allowed area. i have the component enabled on the applicable themes.

update. ok so it is allowing everyone to access the setting from the user menu, and lets you fill out the time etc, but it doesn’t show it in the avatar or user card. can still on the profile.

anyways, no biggie. i love this feature for staff but i’ll look at it later when i have more time.

1 Like

I believe it did work for me on your forum (not totally sure).
I could see the component loaded (I also saw a warning, it’s fixed already) and checked site settings (using the browser console) if enabled before looking at the profile :thinking:

image

Also, just so that you can see, it works on my side:

demo

Let me see If I can figure out what’s happening.
Thanks for testing. :smile:

1 Like

well after a few more tries this morning i still cannot get it work properly for me. it allows my test account to see the set user access option and access the set user status dialog and enter details from the user menu, but not the preferences page. the status also doesn’t show up in the the avatar or profile it seems even if you set it from the user menu. so basically it appears as though it is partially working but not stopping the initial access to the setting. i also using two devices, one logged in as admin and another as a test user. however i am logging out and refreshing the test account whenever i change the settings.

admin settings:


test user:



i’m going to turn off the user status setting again for now.

That’s good news. If partially working, I can fix it. :smile:
I’ve just seen that you’re using the old menu, and I can confirm it’s not handled.
Let me see If I can match all your settings and if I missed some areas!
Thanks for testing also your patience.

hah. i forgot about that. i think i will enable the new one. it’s not much different. i’m more concerned about the sidebar hamburger menu because i know my user base will protest that change more even though i love the sidebar and it is way better, and will also address some of their concerns about navigation. i’m going to enable the sidebar at some point.

if i can get this component to work with the updated user menu, i’m good with that.

edit: nope

but thanks for reminding me about the old menu, i was meaning to enable it.

My apologies for the spam in the wrong section. @JammyDodger :melting_face:

@Lilly Nah, don’t worry, I will cover everything. I’ve already pushed the fix to the old menu, but I’m currently testing edge cases; give me some time, and I will be back to you!

2 Likes

no rush! thank you. and yes my apologies for the messy posting everywhere on this. :woman_facepalming:

just as an FYI i updated the component to get your latest version and same issue.

1 Like

It’s no worries, it’s what my magic buttons are for. :slight_smile: I split it off from the main topic to give you more space to explore the idea and figure it all out. :crossed_fingers:

2 Likes

Do you plan to use it for admin/moderator only (not a specific custom group)? I think I will create a particular version for you if so.

yes exactly. i would like the user status feature only available to staff (admin and mods) if they want to use it. our mods are on and off sometimes inactive for inconsistent periods, and during busier season (soon) when we get a lot more flags and they have to cover for each other. and since i am only admin, i would like my staff and users to know when i am online or going to be inactive for awhile. however i don’t want to start a big make work project for my special case. it would be nice to have a group or at least staff only feature when the actual user status becomes non-experimental.

I love this! But wouldnt this just make it harder since users would still be able to do this with inspect element if they really wanted to?

Just a little heads-up @Arkshine, we may now be looking into adding a ‘group-enabled’ setting for this in core. :+1:

4 Likes

that’s great news. thank you for the update.

3 Likes

Since I haven’t seen group-enabling setting for user statuses in core yet, I made a simple TC that accomplishes what I wanted with this. Can restrict it for any group(s):

4 Likes