unspecific message "You are not authorized to invite people to this room" when on Anti-Spam Ban-List
Steps to reproduce
- use the mjolnir.Module sample synapse config:
modules:
- module: mjolnir.Module
config:
# Prevent servers/users in the ban lists from inviting users on this
# server to rooms. Default true.
block_invites: true
ban_lists:
"!banlist:example.com
- set the user on ban list !banlist:example.com
- Let the banned user invite someone from the server above
Outcome
What did you expect?
A message like:
This server don't allow you to invite it's user
What happened instead?
You are not authorized to invite people to this room
it's really confusing, especially when you are room admin...
technical background
https://matrix.to/#/!IaWNErZAgQUhGqJXjX:matrix.org/$tjKMZ-qM2gae376WlfuOlhfvOqex6M6dRzBhhpYXDJM?via=matrix.org&via=envs.net&via=ubuntu.com
it's probably caused by element getting M_UNAUTHORISED from Synapse which is pretty generic
solutions
There are two possible solutions:
- (preferred) Less generic error message by synapse
- (A Workaround solution) checking the priviliges of the room
There are two possible solutions:
(preferred) Less generic error message by synapse (A Workaround solution) checking the priviliges of the room
Given the mjolnir stuff isn't in the spec the latter option sounds implausible. As for less generic error code that sounds like a Synapse/spec issue rather than an Element one.
Tbh i dont think it would hurt if Element implemented support for an alternative error code if one was to become a Synapse standard or even make it into the spec for when anti spam measures are pre moderating your request.