-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Make power level defaults for new rooms configurable #6660
Comments
Permalink to the code: synapse/synapse/handlers/room.py Lines 828 to 847 in 890c0c0
|
In order to achieve that, I think we only have to change few files: synapse/api/auth.py: (L 522, after is_server_admin function) and registration.py (storage/data_stores/main): (L 294, after is_server_admin func) If somebody is interested |
Just been discussing with a user who is really missing this feature. |
Note that this can currently be achieved through use of a pluggable ThirdPartyEventRules module. An example of such a module doing exactly this currently exists here. The definition of ThirdPartyEventRules is here, and can be configured in Synapse via the homeserver config file. How this works is that ThirdPartyEventRules modules can implement a method called You can of course also set different power levels depending on other things set in |
So how would this work with official Synapse Docker image without actually maintaining a custom Synapse image ourselves? At runtime we can pass either environment variables or a config fragment via command line args #6662 It seems to me that, in regards to power-levels, to hardcode handlers/room.py is easier since we would need to maintain a custom image in either case? So is there a way to actually map a ThirdPartyEventRules python file into the container? Pass a PYTHONPATH environment var with an extra/merged file location which then can be referenced from homeserver.yaml, for example:
|
Is this still planned? Both Changing default power levels without having to maintain a fork of Synapse would be helpful towards staying up-to-date and a couple of Finnish communities were discussing earlier today that if they could set their homeservers to give room creator power level 101 instead of 100 would help with trouble with bridges and similar taking PL100 for themselves. I don't think there is basis for changing it globally (at least without further testing in practice), but that is one example of a case where changing default power levels in Synapse config would be helpful. Others include e.g. giving managed-server server-wide Mjolnir power level. |
After some discussion in #synapse-dev, we're reluctant to add yet another config option for overriding the default power levels in a room, while doing so is possible via a Synapse module. Modules can also inject any events into a room when it is created, affording further flexibility than only In terms of the difficulty of using modules with docker and with debian, making this easier would have a highly positive impact, and help in this instance. Personally, for convenience, it may be nice to have a generic Synapse module which can be configured to inject any type of event into newly created rooms - perhaps even with rules on what rooms should and shouldn't be modified. As for how to actually accomplish this with the module system today, you will want to write one (perhaps using our module template, also see the writing a module documentation) that makes use of the on_create_room module callback. This callback runs when a room is created, is passed a An example of a Synapse module that does this already can be found here. Alternatively, any event(s) can be injected into a newly created room by modifying the For now though, we're unlikely to implement a config option specifically for default power levels while modules can be used instead. |
Description:
Power levels for new rooms are hardcoded (https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room.py#L780), this could be configurable.
The text was updated successfully, but these errors were encountered: