From 094005dca1fd79796a731d5669c0fe0fe6808e0e Mon Sep 17 00:00:00 2001 From: Luca Becker Date: Thu, 18 Jul 2019 08:55:58 +0200 Subject: [PATCH] Incorporated @turt2live suggestions. Added missing added and removed to the rule, because these keys are not required for m.room.power_levels. Also moved the note down to the Note section. --- specification/rooms/v1.rst | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/specification/rooms/v1.rst b/specification/rooms/v1.rst index 6d79323f..eb453b58 100644 --- a/specification/rooms/v1.rst +++ b/specification/rooms/v1.rst @@ -244,8 +244,8 @@ The rules are as follows: #. If there is no previous ``m.room.power_levels`` event in the room, allow. #. For the keys ``users_default``, ``events_default``, - ``state_default``, ``ban``, ``redact``, ``kick``, ``invite`` check if they were changed. - For each of the changed keys: + ``state_default``, ``ban``, ``redact``, ``kick``, ``invite`` check if they + were added, changed or removed. For each found alteration: i. If the current value is higher than the ``sender``'s current power level, reject. @@ -253,15 +253,14 @@ The rules are as follows: #. If the new value is higher than the ``sender``'s current power level, reject. - #. For each entry being added, changed or removed in both the ``events`` and ``users`` keys: + #. For each entry being added, changed or removed in both the ``events`` and + ``users`` keys: i. If the current value is higher than the ``sender``'s current power level, reject. #. If the new value is higher than the ``sender``'s current power level, reject. - - #. (Note: current/new value can also denote the inferred value from either ``users_default``, ``events_default`` or ``state_default``) #. For each entry being changed under the ``users`` key, other than the ``sender``'s own entry: @@ -285,15 +284,19 @@ The rules are as follows: .. NOTE:: - Some consequences of these rules: + * Some consequences of these rules: - * Unless you are a member of the room, the only permitted operations (apart - from the initial create/join) are: joining a public room; accepting or - rejecting an invitation to a room. + * Unless you are a member of the room, the only permitted operations (apart + from the initial create/join) are: joining a public room; accepting or + rejecting an invitation to a room. - * To unban somebody, you must have power level greater than or equal to both - the kick *and* ban levels, *and* greater than the target user's power - level. + * To unban somebody, you must have power level greater than or equal to both + the kick *and* ban levels, *and* greater than the target user's power + level. + + * Power levels may also be inferred from defaults. So, mentions of, for example, + the ``sender``'s power level might also refer to a default power level that is + applied. The same holds true for events. Event format ~~~~~~~~~~~~