m.room.power_levels: clarify documentation

- clarify description and add text for invite, ban, etc.
- the keys aren't required. Document their defaults
- add 'invite' to example
pull/977/head
Richard van der Hoff 8 years ago
parent 0be787a930
commit adb5768731

@ -7,6 +7,7 @@
federated aliases federated aliases
- ``GET /directory/room/{roomAlias}`` cannot return a 409; the ``PUT`` - ``GET /directory/room/{roomAlias}`` cannot return a 409; the ``PUT``
endpoint can, however. endpoint can, however.
- Clarify the behaviour of the ``m.room.power_levels`` event.
r0.1.0 r0.1.0
====== ======

@ -7,6 +7,7 @@
"m.room.power_levels": 100 "m.room.power_levels": 100
}, },
"events_default": 0, "events_default": 0,
"invite": 50,
"kick": 50, "kick": 50,
"redact": 50, "redact": 50,
"state_default": 50, "state_default": 50,

@ -15,14 +15,25 @@ description: |-
``events``, then the user must have at least the level specified in order to ``events``, then the user must have at least the level specified in order to
send that event. If the event type is not supplied, it defaults to send that event. If the event type is not supplied, it defaults to
``events_default`` for Message Events and ``state_default`` for State ``events_default`` for Message Events and ``state_default`` for State
Events. If there is no ``state_default`` in the ``power_levels`` event, the Events.
``state_default`` is 50. If the room contains no ``power_levels`` event, the
``state_default`` is 0. The ``events_default`` is 0 in either of these cases. 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.
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, is defined by ``invite``,
``kick``, ``ban``, and ``redact``, respectively. Each of these levels defaults
to 50 if they are not specified in the ``m.room.power_levels`` event, or if
the room contains no ``m.room.power_levels`` event.
properties: properties:
content: content:
properties: properties:
ban: ban:
description: The level required to ban a user. description: The level required to ban a user. Defaults to 50 if unspecified.
type: number type: number
events: events:
additionalProperties: additionalProperties:
@ -31,19 +42,24 @@ properties:
title: Event power levels title: Event power levels
type: object type: object
events_default: events_default:
description: The default level required to send message events. Can be overridden by the ``events`` key. description: |-
The default level required to send message events. Can be
overridden by the ``events`` key. Defaults to 0 if unspecified.
type: number type: number
invite: invite:
description: The level required to invite a user. description: The level required to invite a user. Defaults to 50 if unspecified.
type: number type: number
kick: kick:
description: The level required to kick a user. description: The level required to kick a user. Defaults to 50 if unspecified.
type: number type: number
redact: redact:
description: The level required to redact an event. description: The level required to redact an event. Defaults to 50 if unspecified.
type: number type: number
state_default: state_default:
description: The default level required to send state events. Can be overridden by the ``events`` key. description: |-
The default level required to send state events. Can be overridden
by the ``events`` key. Defaults to 50 if unspecified, but 0 if
there is no ``m.room.power_levels`` event at all.
type: number type: number
users: users:
additionalProperties: additionalProperties:
@ -52,16 +68,11 @@ properties:
title: User power levels title: User power levels
type: object type: object
users_default: users_default:
description: 'The default power level for every user in the room, unless their ``user_id`` is mentioned in the ``users`` key.' description: |-
The default power level for every user in the room, unless their
``user_id`` is mentioned in the ``users`` key. Defaults to 0 if
unspecified.
type: number type: number
required:
- ban
- events
- events_default
- kick
- redact
- state_default
- users
type: object type: object
state_key: state_key:
description: A zero-length string. description: A zero-length string.

Loading…
Cancel
Save