Skip to content

Commit a505b31

Browse files
committed
MSCXXXX: m.allow recommendation for moderation policy lists
1 parent 712dd41 commit a505b31

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

Diff for: proposals/xxxx-m-allow-recommendation

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# MSC0000: `m.allow` recommendation for moderation policy lists
2+
3+
The [moderation policy lists module] provides data structures to build rule-based moderation features
4+
for Matrix. Each rule in a policy list has a so called recommendation which describes an action to be
5+
taken when the rule matches against a certain subject.
6+
7+
At the time of writing, the only supported recommendation is [`m.ban`]. This is sufficient for building
8+
block-list moderation tools where every entity is permitted by default and only those entities that match
9+
to rules are denied.
10+
11+
With only a single recommendation, however, it's not possible to _also_ support allow-list systems where
12+
every entity is denied by default and only those entities that match to rules are permitted. This is
13+
prominently evidenced by the fact that Mjolnir defines a custom [`org.matrix.mjolnir.allow`] recommendation
14+
to provide both block-list and allow-list semantics[^1].
15+
16+
The proposal at hand attempts to close this gap by standardizing an `m.allow` recommendation.
17+
18+
19+
## Proposal
20+
21+
A new recommendation `m.allow` is introduced. When this recommendation is used, the entities affected by
22+
the rule should be allowed for participation where possible. As with `m.ban`, the enforcement is deliberately
23+
left as an implementation detail. The existing [suggestions] for `m.ban` could simply be inverted, however.
24+
25+
26+
## Potential issues
27+
28+
When both `m.ban` and `m.allow` recommendations are used in the same policy list, confusion could arise if
29+
two rules with opposing recommendations match against an entity. Given that the spec doesn't currently
30+
impose _any_ logic for how policy lists are to be interpreted, it could well leave this question as an
31+
implementation detail, too.
32+
33+
However, if a resolution is indeed desired, the spec could mandate that `m.ban` rules override `m.allow`
34+
rules but not the other way around. This matches both [Mjolnir's implementation] and the way
35+
[server access control lists] are evaluated.
36+
37+
38+
## Alternatives
39+
40+
None that the author could think of.
41+
42+
43+
## Security considerations
44+
45+
None on top of what's already [listed] in the spec.
46+
47+
48+
## Unstable prefix
49+
50+
Until this proposal is accepted into the spec, implementations should refer to `m.allow` as
51+
`org.matrix.mscXXXX.allow`.
52+
53+
54+
## Dependencies
55+
56+
None.
57+
58+
59+
[^1]: A concrete use case that requires both block-list and allow-list semantics can be found in the
60+
Gematik messenger specification for the healthcare sector in Germany. The latter currently depends
61+
on a custom state event to control invite permissions:
62+
https://github.com/gematik/api-ti-messenger/blob/9b9f21b87949e778de85dbbc19e25f53495871e2/src/schema/permissionConfig.json
63+
64+
[`m.ban`]: https://spec.matrix.org/v1.10/client-server-api/#mban-recommendation
65+
[`org.matrix.mjolnir.allow`]: https://github.com/matrix-org/mjolnir/blob/5e35efd1dbc0097a7c19bed2831a1308a29d7be7/src/models/ListRule.ts#L63
66+
[listed]: https://spec.matrix.org/v1.10/client-server-api/#security-considerations-16
67+
[Mjolnir's implementation]: https://github.com/matrix-org/mjolnir/blob/5e35efd1dbc0097a7c19bed2831a1308a29d7be7/src/models/AccessControlUnit.ts#L266
68+
[moderation policy lists module]: https://spec.matrix.org/v1.10/client-server-api/#moderation-policy-lists
69+
[server access control lists]: https://spec.matrix.org/v1.10/client-server-api/#mroomserver_acl
70+
[suggestions]: https://spec.matrix.org/v1.10/client-server-api/#mban-recommendation

0 commit comments

Comments
 (0)