自動グループの可視性はどのように機能しますか?

I’m a bit confused as to how the visibility of automatic groups works. At this point, I am just talking about the /groups directory.
Here is what I am seeing in a pretty fresh install of 2.7.0.beta4:

  • If an user with admin or moderator bits looks at /groups, they see all 8 automatic groups (admins, moderators, staff, trust_level_[0-4]).
  • If a non-admin, non-moderator user (no matter the trust_level) looks at /groups, they see only the moderators group.

But, all of these groups have the same, default Visibility settings:

  • Who can see this group? Logged on users
  • Who can see this group’s members? Everyone

Is this how it is supposed to work? Or is there something wrong with the handling of the Visibility parameters for these groups?

「いいね!」 5

There is a comment in the code that explains what is going on: “hide automatic groups from all non stuff to de-clutter page.” That happens here: discourse/app/controllers/groups_controller.rb at main · discourse/discourse · GitHub.

What the code is doing is overriding the group visibility settings for automatic groups when the groups page is viewed by a non-staff users. Only the moderators group will be displayed.

Unrelated to the issue, but when I tried to onebox the Github link that I posted above, the code was displayed in the onebox without any formatting in the preview:

「いいね!」 3

なるほど、それは説明になります。そして、そのコードは最善の意図で書かれたと確信していますが、それは壊れています。なぜなら:

  1. モデレーター以外の自動グループを表示したい場合があるかもしれません。
  2. 自動グループの管理インターフェースでは、モデレーター以外の自動グループの表示を設定できますが、その設定は無視されます。

そのコードブロック(そして過去6年間生き残ったかわいいタイプミス)を削除するのはかなり簡単でしょう。

もし必要だと考えるなら、トリッキーなのは、現在の自動グループの表示設定を「グループオーナー」に変更することです。これにより、それらが非表示に強制されていることに慣れているすべてのインストールで、これらのグループが誤って表示されるのを防ぐことができます。Discourseには、アップグレード中にそのような変更を行うためのメカニズムがあるかどうかはわかりませんが、スキーマ変更中に必要な種類のものですので、何かあるはずです。

また、「グループカタログで自動グループを非表示にする」という動作は、「visibility_level」の他の側面を不明瞭にするため、悪いことです。例えば、

  • 管理者Xが可視性設定を試してみて、スタッフ以外のユーザーは、設定に関係なく「trust_level_0」をグループカタログで見ることができないことに気づきます。
  • そのため、管理者Xは「visibility_level」と「member_visibility_level」を「Everyone」のままにしておきます。これらの設定は効果がないように見えるためです。
  • 匿名ユーザーZが「/groups/trust_level_0」にアクセスし、サイト上の全ユーザーのリストを取得します。

管理者Xは気にするかもしれませんが、しなくても、それが可能であったことに驚くでしょう。

以前は知らなかった無関係な豆知識

meta.discourseユーザーの信頼レベル別分布:

レベル ユーザー数
TL0 45,942
TL1 29,226
TL2 3,620
TL3 124
TL4 102

こんにちは、mdoggydogさん :slight_smile:

いくつか有効な点があると思います。例えば:

これは紛らわしいですね。

提案については、Feature トピックを作成していただけますでしょうか :slight_smile:

完了しました!

「いいね!」 2

会話は以下で継続されています: Respect the visibility settings of all automatic groups