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
You’re on the right track using the Policy Plugin, 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:
Group name: tos_accepted
Step 2: Post Policy Topic
Create a topic like 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]
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:
Go to category settings → “Security”
Remove trust_level_0
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:
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:
Checks if the user is in tos_accepted
Redirects to the ToS topic if not
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
2 Likes
×
🔔 !
To be safe, if our site ever goes offline, please remember our new domain:
ONEHack.se
We'll continue our "Together We Learn" journey there! 🌟