List of users with locked trust level due to group membership?

I was just investigating an issue with trust levels, and realized that a handful of moderators had their trust level locked and I don’t know why. Does this happen automatically when you promote someone to moderator or shouldn’t their trust levels adjust automatically as they move along and up in the community food chain? Or are there other circumstances when trust levels get locked by the system, not manually by staff?

I worry that other users might have their trust levels similarly locked inadvertently. To ease my concerns I have been hunting for a way to see a list of users with locked trust levels, but to no avail. If this feature exists, please point me to it. The easiest way may be to include it as a column in the user export. Or perhaps someone knows a database explorer query they can share?

Many thanks in advance. :seedling:

4 Likes

Is each lock logged and if so, is the lock presented as a filter that can apply?

Using Data Explorer, you can query them using.
locked-trust-levels.dcquery.json (184 Bytes)

6 Likes

that’s a good idea - I checked, however and there is no admin action log for “locked trust level”.

cool! I’d like to try this but am realizing I am unable to import data queries - clicking the button nothing happens. Am I missing something or is this a bug?

1 Like

That is indeed a bug.

In the meantime this is the query:

SELECT username, trust_level from users WHERE trust_level_locked = true
4 Likes

ok - after refreshing a few times and clicking around in the query explorer I finally got the option to create a new query.

This is super helpful - many thanks. According to your query, it looks like I have 351 users with locked trust levels. This is a fairly random list of users who don’t have anything in common, and they have not been edited.

Any idea why this is happening?

Would you be willing to provide me with a command to reset these to unlocked? Or do I need to go through and unlock each of these one by one?

2 Likes

Ohhh… I think I have an idea what’s happening here. I have been using the group feature to automatically grant a trust level when they are added. Is it possible that this has been actually locking them at this trust level? This is not what I want, and it’s not what I think the feature does. But I can’t think of anything else at the moment.

3 Likes

That may be doing it. IIRC, when TL is set higher than what the user currently qualifies for, it locks them in to prevent the system from downgrading them.

4 Likes

I’m not at a computer right now. I imagine out would be easiest to do via command line but after reading your other post I’m not positive it is a good idea to do so.

1 Like

Thanks! I think I’d rather have the automatic trust level system work than have people locked at a low trust level. So if you can provide the command when you get a chance I’d appreciate it. :seedling:

2 Likes

I believe this should do it. (be sure to backup your instance before running it)

User.where(trust_level_locked: true).update_all(trust_level_locked: false)

Edit:
Well, duh! You could simplify this to (as no user should have a locked TL)

User.update_all(trust_level_locked: false)
5 Likes

To come full circle here - if this is the case, then I suggest updating the helper text for that group setting, from this:

Trust level automatically granted to members when they’re added

to something like this:

Trust level members are automatically granted (and locked at) when they’re added.

2 Likes

If a user with locked trust level moved to a new group, what would happen to the trust level? Does he/she will be granted the new automatic trust level based on the group settings?

I am trying to understand if system is able to adjust the trust level based on the group settings, when trust level is locked for the user. I can see in my log that system attempted to change the trust level, but new and old trust levels are the same.

I would be in favor of a site setting that would prevent this behavior. I have a non-negligible amount of trusted users, which I want to invite to the forum, automatically grant them member status by adding them to a group via domain filter. But I still want them to be able to advance to TL3 and TL4. Or is this a foolish strategy?

I came here searching for answers to a similar question.

What happens to the trust level of a user who is removed from a group that awarded them a higher trust level?

Are they demoted to a lower level if they don’t qualify for the higher trust level anymore? Are they kept at the same level (but are they locked out of getting promoted and demoted? or just demoted?)?

Thanks for your reply!

It seems that query has changed?

Having a quick look at the explorer tables it seems there is now manual_locked_trust_level and group_locked_trust_level if that helps you craft an updated version of what you need?

1 Like

That’s do the trick!

SELECT username from users WHERE manual_locked_trust_level = 1
1 Like