0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 15:55:38 +08:00
discourse/plugins/discourse-policy/spec
Alan Guo Xiang Tan e8669040d1 SECURITY: Validate policy permissions on post save
The `create_policy_allowed_groups` setting controls who can create
policies, but it only gates the composer UI and the
`post_process_cooked` event handler. It does not prevent unauthorized
users from injecting `[policy]` markup directly into post raw — for
example, by editing a wiki post.

Add `DiscoursePolicy::PostValidator` as an ActiveRecord validation on
`Post`. When policies are added, removed, or modified, both the post
owner and the acting user must belong to `create_policy_allowed_groups`
or the save is rejected. Policies inside blockquotes are ignored.
2026-03-19 15:46:24 +00:00
..
fabricators
lib SECURITY: Validate policy permissions on post save 2026-03-19 15:46:24 +00:00
mailers DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
models DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
reports DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
requests SECURITY: Add authorization to policy add-users-to-group 2026-03-19 15:46:24 +00:00
serializers DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
system
plugin_spec.rb SECURITY: Validate policy permissions on post save 2026-03-19 15:46:24 +00:00