Discourseポリシー

:discourse2: Summary Discourse Policy gives the ability to confirm your users have seen or done something, with optional reminders.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Features

Discourse policy shares much of its DNA with polls, it has the goal of ensuring members of a group accept certain policies by clicking a button.

It has some specific features that set it apart from polls:

  1. It must apply to a group.

  2. It can optionally nag members of a group either weekly or daily to click accept on a policy.

  3. The UX makes it very easy to see who accepted and who did not accept a policy.

Configuration

Screenshots

Before clicking accept

After clicking “grey” person on top right

After clicking accept

Creating a policy

Discourse policy registers a custom [policy] BBCode element. Which means you need to write this block of code in your post where you want to show this policy.

[policy group=founders reminder=daily]
I accept this policy will annoy me daily until I click accept
[/policy]

In this case the policy applies to the founders group and a reminder is sent daily to all users that did not accept the policy.

Site settings

policy_enabled : Enable the discourse policy plugin on the site.

policy_restrict_to_staff_posts: Policies may only appear on staff posts.

policy easy revoke: Show the accept and revoke buttons at the same time.

BBCode attributes

The [policy] element can accept the following attributes.

  • group: the group name that policy will apply to required
  • version: the version number of the policy, bump number up to require all users re-accept the policy
  • reminder: remind users of the group to accept policy (weekly or daily), optional, default off
  • accept: text used for accept button, default is “Accept Policy”
  • revoke: text used for revoke button, default is “Revoke Policy”
  • renew: number of days or text describing period (monthly, quarterly or yearly) after which a user needs to re-accept policy
  • renew-start: the first date renewals will start at Eg: 17-10-2017, useful if you want to set the renewal cadence so it happens every half-year (Jan,June)
  • add-users-to-group: accepts a single group as input; users who accept the policy will be automatically added into this group (when policy is manually revoked or if the policy version is updated, user(s) gets removed from group)
  • private: hide users who accepted/did not accept the policy

:information_source: The backend job to check for policy reminders runs every 6 hours. If the reminder element is set to weekly or daily, users who have not accepted a policy will be sent notification reminders to accept the policy only if they have not already received a reminder notification for the policy within the past week or day.

Usage examples

Basic policy:

[policy group="team" reminder="daily" accept="Accept" revoke="Ignore" version="1"]
I have read, understand and acknowledge this policy.
[/policy]

Bumping the revision number, to require that everyone reads the update:

[policy group="team" reminder="daily" accept="Accept" revoke="Ignore" version="2"]
I have read, understand and acknowledge this policy. (Last updated [date=2020-04-23 timezone="America/Los_Angeles"])
[/policy]

Periodic auditing task:

[policy group="audit_committee" reminder="weekly" renew="90" renew-start="01-07-2019" version="1" accept="Assignment Complete"] 
I have ensured that someone is assigned to this quarterly audit task.
[/policy]

CHANGELOG

TODO

  • Optional immediate reminder for new policies
  • Possibly allow certain groups to apply policies (expanding on staff)

Last edited by @david 2025-07-22T13:14:42Z

Check documentPerform check on document:
「いいね!」 65

2件の投稿が新しいトピックに分割されました:ポリシー作成をスタッフのみに制限しますか?

4件の投稿が新しいトピックに分割されました:特定のポリシーへの同意の取り消しを禁止することは可能ですか?

このコミットで 200 の制限と policy_max_group_size が削除されたようですが、何か見落としていることはありますか?

「いいね!」 3

6件の投稿が新しいトピックに分割されました:ポリシーを承認したにもかかわらずリマインダーを受け取っているユーザー

長いボタンテキストを持つポリシーが大規模グループに適用されると、UIが破損します。以下のスクリーンショットでは、アバターがほぼ無限の列を形成しており、少し不格好になっています。CSSを確認して簡単に修正できるか調べますが、おそらく何らかのデザイン変更が必要でしょう。

.cooked .policy .user-lists から display: flex を削除すると、デスクトップでは問題なく表示されます。

最終的に以下のCSSを使用しました。

/* ポリシーのユーザーリストがあふれないようにする */
.cooked .policy .user-lists {
    display: block;
}
「いいね!」 3

プラグインをインストールした後にエラーが発生しました。理由がわかりません。「/admin/dashboard/general.json](https://forum.wangyx.com/admin/dashboard/general.json)を読み込もうとしている間」に関連しているようです。

サーバーエラー

[/admin/plugins]を読み込もうとしている間

エラーコード: 500エラー

おっと

このディスカッションフォーラムを支えるソフトウェアで予期せぬ問題が発生しました。ご迷惑をおかけして申し訳ありません。

エラーに関する詳細情報は記録され、自動通知が生成されました。確認いたします。

それ以上の操作は必要ありません。ただし、エラー状態が続く場合は、エラーを再現するための手順を含め、追加の詳細をサイトのフィードバックカテゴリにディスカッションを投稿することで提供できます。

こんにちは

ポリシーが返信を許可しないカテゴリトピックでクローズされている場合、承認/拒否ボタンは表示されますか?

ありがとうございます

しばらくこのプラグインを使用していませんが、トピックが閉じられたときにユーザーが受け入れ/取り消しを許可できると思います。ボタンを押しても返信にはならないため、閉じることがそれを防ぎます。

「いいね!」 1

こんにちは、質問があります:
Discourse Policy プラグインを使用して、新規ユーザーに利用規約 (ToS) の同意を強制したいと考えています。要件:

  • 同意しない場合 → フォーラムを使用できない (ToS ページのみ表示)
  • 同意した場合 → フォーラムを使用できる + “ToS” バッジを取得

私の解決策は、新しいトピックを作成し、その中に以下を追加することでした:
[policy group=trust_level_0 reminder=daily add-users-to-group=tos_accepted accept=“利用規約に同意します” version=“1”]
「利用規約に同意します」をクリックすると、利用規約を読み、同意したことを確認します。
[/policy]

しかし、新しいユーザーがログインしてもポリシーがまったく表示されず、彼は好きなようにできてしまいます。 「同意」をクリックした場合のみ、ページにアクセスできるようにしたいと考えています。どうすればいいですか、そしてありがとうございます。

カスタムフィールドを使用して、利用規約とFAQページをリンクさせることができます。ユーザーがそれらを読んだら、「ガイドラインを読んだ」バッジを受け取ります。

「いいね!」 2

お返事ありがとうございます。おっしゃる通りに動作しました。しかし、本当にやりたいことは、ユーザーがログインした後にこのバナーを表示し、「承諾」をクリックした場合にのみページへのアクセスを許可することです。そうでない場合は、バナーが表示されたままで、ユーザーはページを操作できないようにしたいのです。

現在の状況は以下の通りです。


その後、ユーザーは通常通りページにアクセスできます。

そのような方法はありますでしょうか。よろしくお願いします。

:partying_face: このプラグインは、Bundling more popular plugins with Discourse core の一部として、Discourse コアにバンドルされるようになりました。セルフホストでこのプラグインを使用している場合は、次回のアップグレード前に app.yml から削除する必要があります。

「いいね!」 3

ユーザーをグループから削除する機能を追加していただけると幸いです。承認または拒否時に。

現在のところ、この機能はユーザーに(オプションで)通知し、追加するだけです。私が何か見落としているのでなければ。

ありがとうございます!

「いいね!」 1