Skip to content

Commit 2fdc634

Browse files
richvdhclokep
authored andcommitted
Remove outdated text saying that state_default defaults to 0 (matrix-org#1479)
There was substantial confusion around this, but I've done some archaeology. Basically, this was changed back in r0.5.0 by MSC1304 and matrix-org/synapse#3397. Before that, it was indeed the case that state_default was 0 if there was no m.room.power_levels event, but that was confusing and a source of security holes, so we changed it. matrix-org/matrix-spec-proposals#1656 changed the spec, but apparently overlooked the text in the description. Reverts: matrix-org#1478. Fixes: matrix-org#861.
1 parent 4c44b18 commit 2fdc634

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

changelogs/client_server/newsfragments/1478.clarification

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove outdated text saying that `state_default` is 0 if there is no `m.room.power_levels` event in a room.

data/event-schemas/schema/m.room.power_levels.yaml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ description: |-
1818
`events_default` for Message Events and `state_default` for State
1919
Events.
2020
21-
If there is no `state_default` in the `m.room.power_levels` event, the
22-
`state_default` is 50. If there is no `events_default` in the
23-
`m.room.power_levels` event, the `events_default` is 0. If the room
24-
contains no `m.room.power_levels` event, *both* the `state_default` and
25-
`events_default` are 0.
21+
If there is no `state_default` in the `m.room.power_levels` event, or
22+
there is no `m.room.power_levels` event, the `state_default` is 50.
23+
If there is no `events_default` in the `m.room.power_levels` event,
24+
or there is no `m.room.power_levels` event, the `events_default` is 0.
2625
2726
The power level required to invite a user to the room, kick a user from the
2827
room, ban a user from the room, or redact an event sent by another user, is
@@ -33,15 +32,6 @@ description: |-
3332
3433
**Note:**
3534
36-
As noted above, in the absence of an `m.room.power_levels` event, the
37-
`state_default` is 0, and all users are considered to have power level 0.
38-
That means that **any** member of the room can send an
39-
`m.room.power_levels` event, changing the permissions in the room.
40-
41-
Server implementations should therefore ensure that each room has an
42-
`m.room.power_levels` event as soon as it is created. See also the
43-
documentation of the `/createRoom` API.
44-
4535
The allowed range for power level values is `[-(2**53)+1, (2**53)-1]`,
4636
as required by the [Canonical JSON specification](/appendices/#canonical-json).
4737
@@ -75,9 +65,6 @@ properties:
7565
description: |-
7666
The default level required to send state events. Can be overridden
7767
by the `events` key. Defaults to 50 if unspecified.
78-
79-
**Note**: When there is no `m.room.power_levels` event in the room, this defaults
80-
to 0. See description for more information.
8168
type: integer
8269
users:
8370
additionalProperties:
@@ -87,9 +74,11 @@ properties:
8774
type: object
8875
users_default:
8976
description: |-
90-
The default power level for every user in the room, unless their
91-
`user_id` is mentioned in the `users` key. Defaults to 0 if
77+
The power level for users in the room whose `user_id` is not mentioned in the `users` key. Defaults to 0 if
9278
unspecified.
79+
80+
**Note**: When there is no `m.room.power_levels` event in the room, the room creator has
81+
a power level of 100, and all other users have a power level of 0.
9382
type: integer
9483
notifications:
9584
properties:

0 commit comments

Comments
 (0)