-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add default_power_level_content_override config option. #12535
Conversation
Lets you override the default power levels for rooms created on this server, per room creation preset. Useful if you know that your users need special permissions in rooms that they create (e.g. to send particular types of state events without needing an elevated power level). This takes the same shape as the power_level_content_override parameter in the /createRoom API, but is applied before that parameter. This is something of a workaround in the absence of MSC3779 or MSC3761.
An example use of this would be something like: default_power_level_content_override:
private_chat: { "events": { "com.example.foo" : 0 } }
trusted_private_chat: { "events": { "com.example.foo" : 0 } }
public_chat: { "events": { "com.example.foo" : 0 } } ...to let users in locally created rooms set |
if power_level_content_override: | ||
power_level_content.update(power_level_content_override) | ||
|
||
# override default_power_level_content_override for this room preset, if any | ||
default_power_level_content_override = ( | ||
self.config.room.default_power_level_content_override | ||
) | ||
if ( | ||
default_power_level_content_override | ||
and default_power_level_content_override.get(preset_config) | ||
): | ||
power_level_content.update( | ||
default_power_level_content_override.get(preset_config) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for default_power_level_content_override
says that it's applied before power_level_content_override
, but here it is the other way around?
# This is something of a workaround in the absence of MSC3779 or MSC3761. | ||
# | ||
#default_power_level_content_override: | ||
# private_chat: null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some example non-null content might help admins understand what goes here:
# private_chat: null | |
# private_chat: { "events": { "com.example.foo" : 0 } } |
power_level_content.update( | ||
default_power_level_content_override.get(preset_config) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an admin were to configure an override like: private_chat: { "events": { "com.example.foo" : 0 } }
, the entire default "events": {"m.room.name": ..., ...}
content from above will be replaced. Is this intended behaviour?
kind of related to matrix-org/matrix-spec#492
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a test for this change before we can merge the PR.
And an entry in the config manual too, please. |
I am attempting to address the comments here in #12618 |
sorry for completely missing this while travelling/catching up - @andybalaam thanks for taking it over. |
Lets you override the default power levels for rooms created on this server, per
room creation preset.
Useful if you know that your users need special permissions in rooms
that they create (e.g. to send particular types of state events without
needing an elevated power level). This takes the same shape as the
power_level_content_override parameter in the /createRoom API, but
is applied before that parameter.
This is something of a workaround in the absence of MSC3779 or MSC3761.
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)