كيف يمكنني ترقية جميع المستخدمين إلى مستوى الثقة 1؟

منتداك مخصص للأعضاء الدافعين في منطمتنا، لذا يبدو أن الرسائل المزعجة ليست مشكلة. للأسف، وبسبب التبديل التلقائي لمستوى الثقة الافتراضي بعد 50 مستخدمًا، لدينا حاليًا عدد قليل من المستخدمين الذين لديهم مستوى ثقة 0.

هل توجد طريقة للعثور على المستخدمين الذين لديهم مستوى ثقة 0 وترقيتهم إلى مستوى ثقة 1؟ لاحظت أن المستخدمين الذين لديهم مستوى ثقة 1 يظهرون أيضًا في مجموعة مستوى الثقة 0، لذا فإن الجميع موجودون في تلك المجموعة. شكرًا لك! :slightly_smiling_face:

How many users are we talking about? You can see users who have only Trust Level 1 from the admin report /admin/users/list/newuser. This does not include users with TL1 or higher. From here you can manually up the user’s trust levels. You are correct that all users on the site technically have TL0, even if they also have a greater trust level. If a lot, a rails command is your best bet.

You should also make sure to change the site setting default trust level if you want all users to have TL1.

Thanks! We only had about 7 users at level 0, so it was easy to upgrade them manually. We’ve also set our default trust level to 1, and may even bump it to 2 if users are running into posting limits. I’ll look into the rails commands if we go that route.

@jomaxro For future reference, is there a known way to do this via the command line, or would I have to construct a custom command? Thanks!

Sure! @pfaffman shared some commands in Migrated to Discourse and system is creating hundreds of flagged posts. Backup is always recommended when running potentially destructive commands. Just modify the User.where( command to suit your needs, the rest should be good to go.

مرحباً،
لقد استخدمت users.update_all(trust_level: 2) على بعض المستخدمين ذوي مستوى الثقة 1. أصبح المستخدمون الآن بمستوى ثقة 2:


لكنهم لا ينتمون إلى المجموعة ذات الصلة:

هل سيتم إضافتهم إلى هذه المجموعة تلقائياً لاحقاً؟ هل هناك مهمة Sidekiq يجب تنفيذها؟
ماذا لو قمنا بتخفيض مستوى ثقة المستخدم من سطر الأوامر (المستوى 4 → المستوى 2)؟

لقد فهمت الأمر.
المهمة في Sidekiq التي تُفعّل ملء مجموعات مستويات الثقة هي EnsureDbConsistency.

بعد تحديث مستويات ثقة المستخدمين من سطر الأوامر (سواء بزيادة أو نقصان مستويات الثقة)، ستقوم EnsureDbConsistency بنقل المستخدمين داخل وخارج هذه المجموعات.