# Discourse policy

**URL:** <https://onehack.st/t/discourse-policy/305953>\
**Category:** Discussion & Solutions\
**Tags:** solved\
**Created:** [June 3, 2025, 10:55am UTC](https://onehack.st/t/discourse-policy/305953 "2025-06-03T10:55:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![7bika](https://onehack.st/user_avatar/onehack.st/7bika/32/114058_2.png) [@7bika](https://onehack.st/u/7bika)\
**Post date:** [June 3, 2025, 10:55am UTC](https://onehack.st/t/discourse-policy/305953/1 "2025-06-03T10:55:11Z")

</div>

hi i have a question since this is a discourse forum :  
We want to use the Discourse Policy plugin to : **force first-time users to accept Terms of Service (ToS)**. Requirements:

- If they don’t accept → they cannot use the forum (only see ToS page)
- When they accept → they can use the forum + get a “ToS” badge

my solution was to create a new subject and within i added this :  
[policy group=trust\_level\_0 reminder=daily add-users-to-group=tos\_accepted accept=“I Accept Terms” version=“1”]  
By clicking “I Accept Terms”, I confirm that I have read and agree to the Terms of Service.  
[/policy]

but if a new user logs in the policy doesn’t show up at all and he can do whatever he wants we want only if he click on “Accept” to be able to access our page . how to do that and thanks

---

<div class="post-metadata">

**Author:** ![Harlynish](https://onehack.st/user_avatar/onehack.st/harlynish/32/147232_2.png) [@Harlynish](https://onehack.st/u/Harlynish)\
**Post date:** [June 3, 2025, 1:27pm UTC](https://onehack.st/t/discourse-policy/305953/2 "2025-06-03T13:27:02Z")

</div>

You’re on the right track using the [Policy Plugin](https://meta.discourse.org/t/policy-plugin/124817), but by itself, the plugin **does not enforce restrictions** on what users can or cannot do before accepting. It **only posts an acceptance button and optionally adds users to a group**.

To achieve your goal of **forcing acceptance before participation** , you need to combine the Policy Plugin with **category restrictions** and potentially a bit of Discourse customization.

* * *

### ✅ Desired Behavior Recap

| Feature | Supported by Policy Plugin? | Additional Setup Needed? |
| --- | --- | --- |
| Show ToS and get explicit “Accept” | ✅ Yes | No |
| Block access to rest of the forum | ❌ No | ✅ Yes |
| Grant badge when accepted | ✅ Yes (manually or via group) | Possibly |

* * *

## ✅ Step-by-Step Solution

### **Step 1: Create a “ToS Acceptance” Group**

You already did this part:

```plaintext
Group name: tos_accepted

```

### **Step 2: Post Policy Topic**

Create a topic like this:

```markdown
[policy group=trust_level_0 reminder=daily add-users-to-group=tos_accepted accept="I Accept Terms" version="1"]
By clicking “I Accept Terms”, I confirm that I have read and agree to the Terms of Service.
[/policy]

```

Make sure this topic is **visible to everyone** , including users not in `tos_accepted`.

### **Step 3: Restrict Access to All Other Categories**

For each other category in your forum:

1. Go to category settings → “Security”
2. Remove `trust_level_0`
3. Add `tos_accepted` with permissions (see, reply, create)

This means **only users in `tos_accepted` can see or post in these categories**.

### **Step 4: Optional – Add Badge for Acceptance**

To auto-assign a badge, create a custom badge with this SQL query:

```sql
SELECT user_id, current_timestamp as granted_at
FROM group_users
WHERE group_id = (SELECT id FROM groups WHERE name = 'tos_accepted')

```

Set this badge to **run daily** or **trigger manually** after testing.

* * *

## 🚫 What Not To Expect

- Policy Plugin does **not force redirect** to a specific topic.
- There’s **no native way** to block all access except one topic.

* * *

## 🔁 Optional (Advanced) – Auto-redirect on login

If you really want to force new users to **only see** the ToS topic until they accept, you’d need:

- A small plugin or theme component that:

This requires custom development. Let me know if you’d like help writing such a plugin or a theme component.

* * *

## ✅ Summary

| Requirement | Solution |
| --- | --- |
| Show ToS and require acceptance | Policy plugin + topic |
| Block access until acceptance | Restrict all categories to group `tos_accepted` |
| Show reminder daily | Use `reminder=daily` in policy tag |
| Badge for accepted users | Use badge query on `tos_accepted` group |
