バグ - 管理者が PM アクセス権を持たないモデレーターに PM を割り当てられる可能性

I have noticed what I think is a bug with the Discourse Assign - #117 plugin. It is possible for an admin to assign a PM to a moderator who does not have access to the PM. They are notified, but when they click through to see the PM they cannot see it and get an error.

The answer, it seems to me, should be to add the assignee to the message at the same time, or to display an error to the assigner to let them know the assignee is not in the message and cannot be assigned the message.

This obviously does not affect admins who can see all PMs.

「いいね!」 5

I can repro this. An assign notification is generated despite the user not having access to the PM assigned. Same issue occurs in categories with security that mods can’t access.

「いいね!」 5

Oh yeah interesting edge case what can we do here @sam?

「いいね!」 4

I think a minimum change here is to pop up an error saying moderator has no access to the PM when the admin / mod tries to assign.

This particular edge case will become much less of an edge case when we unlock “assign” to designated groups that are not mods.

「いいね!」 4

今日またこれに気づきました。モデレーターに多くのメッセージを割り当てていましたが、彼らにはそれらにアクセスする権限がなく、そのためフォローアップがなされていませんでした。おっと。

「いいね!」 2

笑えるね、@sam、上記の問題を何か簡単な方法で防げるかな?

「いいね!」 3

今回この問題が発生しました。@Roman さんがフォローアップしていただけると幸いです。

「いいね!」 5

トピックを割り当てる際に追加のルールを適用するための PR を作成しました。

  • 割り当てる対象のユーザーは、割り当て権限を持っている必要があります。
  • 割り当てる対象のユーザーは、そのトピックへのアクセス権を持っている必要があります。

これらの条件を満たさないユーザーへの割り当てを試みると、以下のエラーが発生します。

また、アクセス権のないユーザーを割り当てモーダルの検索結果から除外すべきだと考えています。これを実現するためには、コアのユーザー検索 API を少し拡張する必要があります。

PR はこちらです:

マージする前に、レビューしてくれる人を見つけます。

「いいね!」 6