List of users with locked trust level?

(Tobias Eigen) #1

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:

(Graham Perrin) #2

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

(cpradio) #3

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

(Tobias Eigen) #4

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?

(cpradio) #5

That is indeed a bug.

In the meantime this is the query:

SELECT username, trust_level from users WHERE trust_level_locked = true

(Tobias Eigen) #6

thanks! but create new doesn’t work now either. :slight_smile: I’ll have to wait for the bug to be fixed.

(cpradio) #7

Try refreshing the page. Create worked for me, as I literally just made that query.

(Tobias Eigen) #8

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?

(Tobias Eigen) #9

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.

See trust level 3 progress
(cpradio) #10

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.

(cpradio) #11

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.

(Tobias Eigen) #12

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:

(cpradio) #13

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)

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

User.update_all(trust_level_locked: false)

(Robin Ward) #14

Looks like it regressed when we refactored themes. This commit fixes it:

(Sam Saffron) #15

Sorry :cold_sweat: I should have been more careful here, totally my fault.

(Tobias Eigen) #16

I just updated and can confirm that this is fixed now. Thanks!!

Thanks also @cpradio for providing the query to update trust_level_locked for all users. I just ran it and all appears to be well. :sweat_smile:

Still have to wait and see how the trust levels start to flow now - will certainly be interesting!

(Tobias Eigen) #17

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.

(Behzad Khanaliloo) #18

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.

(Daniel Hollas) #19

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?