element-meta icon indicating copy to clipboard operation
element-meta copied to clipboard

unspecific message "You are not authorized to invite people to this room" when on Anti-Spam Ban-List

Open JokerGermany opened this issue 1 year ago • 2 comments

Steps to reproduce

  1. 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
  1. set the user on ban list !banlist:example.com
  2. 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 grafik

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:

  1. (preferred) Less generic error message by synapse
  2. (A Workaround solution) checking the priviliges of the room

JokerGermany avatar Aug 21 '24 15:08 JokerGermany

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.

t3chguy avatar Aug 28 '24 10:08 t3chguy

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.

FSG-Cat avatar Aug 12 '25 19:08 FSG-Cat