Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated text saying that state_default defaults to 0 #1479

Merged
merged 4 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove outdated text saying that `state_default` is 0 if there is no `m.room.power_levels` event in a room.
21 changes: 4 additions & 17 deletions data/event-schemas/schema/m.room.power_levels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ description: |-
`events_default` for Message Events and `state_default` for State
Events.

If there is no `state_default` in the `m.room.power_levels` event, the
`state_default` is 50. If there is no `events_default` in the
`m.room.power_levels` event, the `events_default` is 0. If the room
contains no `m.room.power_levels` event, *both* the `state_default` and
`events_default` are 0.
If there is no `state_default` in the `m.room.power_levels` event, or
there is no `m.room.power_levels` event, the `state_default` is 50.
If there is no `events_default` in the `m.room.power_levels` event,
or there is no `m.room.power_levels` event, the `events_default` is 0.

The power level required to invite a user to the room, kick a user from the
room, ban a user from the room, or redact an event sent by another user, is
Expand All @@ -33,15 +32,6 @@ description: |-

**Note:**

As noted above, in the absence of an `m.room.power_levels` event, the
`state_default` is 0, and all users are considered to have power level 0.
That means that **any** member of the room can send an
`m.room.power_levels` event, changing the permissions in the room.

Server implementations should therefore ensure that each room has an
`m.room.power_levels` event as soon as it is created. See also the
documentation of the `/createRoom` API.

The allowed range for power level values is `[-(2**53)+1, (2**53)-1]`,
as required by the [Canonical JSON specification](/appendices/#canonical-json).

Expand Down Expand Up @@ -75,9 +65,6 @@ properties:
description: |-
The default level required to send state events. Can be overridden
by the `events` key. Defaults to 50 if unspecified.

**Note**: When there is no `m.room.power_levels` event in the room, this defaults
to 0. See description for more information.
Comment on lines -79 to -80
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably should have done it in my original PR, but while you're here it'd be good to have a similar note for the "creator gets 100" clause on users_default (effectively).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note in 4a90545 (and clarified the rest of the description of users_default too

type: integer
users:
additionalProperties:
Expand Down