0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/spec/requests/api
Martin Brennan e590d2a2d5
DEV: Add banned_acl concept to AccessControlList (#41254)
Introduces a server-side definition of banned_acl,
similar to mandatory_acl from 5823e4e3b2

This allows AclTarget implementing classes to define
which ACLs cannot be used for certain types. For example:

```
def self.banned_acl
  [{ type: :group, id: Group::AUTO_GROUPS[:anonymous_users], permission: "edit" }]
end
```

This prevents anonymous users group from being able to have the Edit
permission on the target, which is practical because the anonymous
user is not logged in and generally cannot create/edit anything.

This restriction is passed to the DAccessControl component via the Site
serializer, same as mandatory_acl, and is used to prevent the user from
selecting the banned ACLs in the UI.

Then, server-side this rule is enforced in `AccessControlListManager`
service as a policy.

**Before**

<img width="971" height="287" alt="image"
src="https://github.com/user-attachments/assets/af4ace0f-7b11-4005-8344-774d554693f0"
/>


**After**

<img width="914" height="194" alt="image"
src="https://github.com/user-attachments/assets/b756b976-f6e6-4331-b27d-c9a2d13997aa"
/>
2026-06-29 16:22:30 +10:00
..
schemas DEV: Add banned_acl concept to AccessControlList (#41254) 2026-06-29 16:22:30 +10:00
shared DEV: Improve JSON schema failure output in API specs (#41182) 2026-06-25 15:55:40 +10:00
backups_spec.rb DEV: Restore and update request/api specs (#39483) 2026-04-23 20:13:52 +02:00
badges_spec.rb
categories_spec.rb
groups_spec.rb DEV: Fix api docs openapi spec validation errors (#35361) 2025-10-14 07:32:58 -06:00
invites_spec.rb DEV: Update api docs spec for invite enpoint (#34843) 2025-09-17 14:50:53 -05:00
multiple_invites_spec.rb
notifications_spec.rb
posts_spec.rb DEV: Update api-docs for posts locked endpoint (#35453) 2025-10-16 12:56:34 -06:00
private_messages_spec.rb
rate_limits_spec.rb
search_spec.rb DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
site_spec.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
tags_spec.rb DEV: Use tag_name/tag.name instead of tag_id/tag.id where the name is actually used (#36226) 2025-12-29 13:20:06 +08:00
topics_spec.rb DEV: Fix api docs openapi spec validation errors (#35361) 2025-10-14 07:32:58 -06:00
uploads_spec.rb DEV: Restore and update request/api specs (#39483) 2026-04-23 20:13:52 +02:00
user_badges_spec.rb
users_spec.rb FIX: Reject DiscourseConnect SSO payloads when secret is blank (#40830) 2026-06-12 15:17:16 +03:00