docs-matrix-spec/event-schemas/schema/m.room.power_levels
Richard van der Hoff 5b12e2cfef Convert event schemas to yaml
We've decided to make the event schemas YAML, so we might as well take
advantage of it.

(This conversion was done mostly automatically, except for:
 - s/null/"null"/ in m.room.member
 - reformat description in m.room.power_levels
2016-06-22 12:01:08 +01:00

75 lines
2.7 KiB
Text

---
allOf:
- $ref: core-event-schema/state_event.yaml
description: |-
This event specifies the minimum level a user must have in order to perform a
certain action. It also specifies the levels of each user in the room.
If a ``user_id`` is in the ``users`` list, then that ``user_id`` has the
associated power level. Otherwise they have the default level
``users_default``. If ``users_default`` is not supplied, it is assumed to be
0.
The level required to send a certain event is governed by ``events``,
``state_default`` and ``events_default``. If an event type is specified in
``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
``events_default`` for Message Events and ``state_default`` for State
Events. If there is no ``state_default`` in the ``power_levels`` event, the
``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.
properties:
content:
properties:
ban:
description: The level required to ban a user.
type: number
events:
additionalProperties:
type: number
description: The level required to send specific event types. This is a mapping from event type to power level required.
title: Event power levels
type: object
events_default:
description: The default level required to send message events. Can be overridden by the ``events`` key.
type: number
invite:
description: The level required to invite a user.
type: number
kick:
description: The level required to kick a user.
type: number
redact:
description: The level required to redact an event.
type: number
state_default:
description: The default level required to send state events. Can be overridden by the ``events`` key.
type: number
users:
additionalProperties:
type: number
description: The power levels for specific users. This is a mapping from ``user_id`` to power level for that user.
title: User power levels
type: object
users_default:
description: 'The default power level for every user in the room, unless their ``user_id`` is mentioned in the ``users`` key.'
type: number
required:
- ban
- events
- events_default
- kick
- redact
- state_default
- users
type: object
state_key:
description: A zero-length string.
pattern: '^$'
type: string
type:
enum:
- m.room.power_levels
type: string
title: Defines the power levels (privileges) of users in the room.
type: object