Add knock_restricted to v10 auth

This commit is contained in:
Travis Ralston 2022-05-30 14:43:44 -06:00
parent 017461823b
commit 0eec78d8d6

View file

@ -15,7 +15,17 @@ members of a room join either through knocking (introduced in [room version 7](/
or through "join restrictions" (introduced in [room version 8](/rooms/v8) and
refined in [room version 9](/rooms/v9)).
Clients should render the new join rule accordingly for such rooms.
Clients should render the new join rule accordingly for such rooms. For example:
```
This room is:
[ ] Public
[x] Private
Join rules (disabled when Public):
[x] Allow members of `#space:example.org` to join
[x] Allow knocking
```
Clients which implement the redaction algorithm locally should refer to the
[redactions](#redactions) section below for a full overview.
@ -115,7 +125,8 @@ The rules are as follows:
3. If the `sender` is banned, reject.
4. If the `join_rule` is `invite` or `knock` then allow if
membership state is `invite` or `join`.
5. If the `join_rule` is `restricted`:
5. {{< changed-in this="true" >}}
If the `join_rule` is `restricted` or `knock_restricted`:
1. If membership state is `join` or `invite`, allow.
2. If the `join_authorised_via_users_server` key in `content`
is not a user with sufficient permission to invite other
@ -170,7 +181,9 @@ The rules are as follows:
than the `sender`'s power level, allow.
3. Otherwise, reject.
7. If `membership` is `knock`:
1. If the `join_rule` is anything other than `knock`, reject.
1. {{< changed-in this="true" >}}
If the `join_rule` is anything other than `knock` or
`knock_restricted`, reject.
2. If `sender` does not match `state_key`, reject.
3. If the `sender`'s current membership is not `ban`, `invite`,
or `join`, allow.