So I got in an incredibly annoying situation:
How can I resolve this?
I eventually figured out an (extremely hacky) workaround:
synapse/event_auth.pyreturn True on the line after def _can_send_eventreturn True on the line after def _check_power_levelsClearly this is not the best choice. I think in production return True should be replaced with if is_server_admin: return True.
How does one set the power level in the postgres database?
This issue should probably be closed. The advice above should not be followed as it messes with event authorization which will not work over federation.
I'm admin or moderator of a room (I forget)
I add a moderator to a room
The moderator kicks and bans me by accident, then unbans me and reinvites me
Now nobody in the room has the permissions necessary to add/remove moderators
This doesn't sound right, incidentally. You should end up with the same power-level after ban/rejoin as you had before it.
How does one set the power level in the postgres database?
I tried to figure that out today, but it did not work. Tried about five different routes, but things don't behave as in the API documentation. Namely, even when I there are no m.room.power-levels messages left for the room and I am entered as the creator as the room in table rooms and have restarted the Matrix server and reloaded the , I am still not admin in that room. There's probably something going on with caching that I don't see. But it's not client-side local storage, because it also happens in Firefox Private Mode.
So doing things in the database is not a solution (for now). On top of that, the Matrix Admin API does not contain a function to modify room membership or permissions. So being a "server admin" user does not help here, either.
I propose to re-open this issue and implement changing power levels and room membership in the admin API.
Most helpful comment
I eventually figured out an (extremely hacky) workaround:
synapse/event_auth.pyreturn Trueon the line afterdef _can_send_eventreturn Trueon the line afterdef _check_power_levelsClearly this is not the best choice. I think in production
return Trueshould be replaced withif is_server_admin: return True.