Discourse Policy

:discourse2: Summary Discourse Policy gives the ability to confirm your users have seen or done something, with optional reminders.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-policy
:open_book: Install Guide How to install plugins in Discourse

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)

: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 @SaraDev 2024-09-10T20:31:18Z

Check documentPerform check on document:
64 Likes

2 posts were split to a new topic: Limit Policy creation to just staff?

4 posts were split to a new topic: Is it possible to disallow revoking agreement to certain policies?

It looks like the 200 limit and the policy_max_group_size got removed with this commit. Am I missing something?

3 Likes

6 posts were split to a new topic: People receiving reminders even though they’ve accepted the policy

When a policy with long button text is applied to a large group, the UI gets mangled: in the screenshot below, we can see that the avatars form an near infinite column that makes it a bit akward. I will look into the CSS to see if that can be easily fixed, but probably there should be some kind of redesign:

Removing display: flex on .cooked .policy .user-lists makes it look fine on Desktop:

image

I ended up using the following CSS:

/* Make policy user list not overflow */
.cooked .policy .user-lists {
    display: block;
}
2 Likes

Error after installing the plugin. Don’t know why. Something related “while trying to load /admin/dashboard/general.json”.

Server Error

while trying to load [/admin/plugins]

Error code: 500 error

Oops

The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.

Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.

No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site’s feedback category.