Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Inaccurate error message: "You don't have permission to ban" when banning or unbanning someone with same or higher PL. #16202

@Gnuxie

Description

@Gnuxie

Description

POST /_matrix/client/v3/rooms/!NmyHBEdVXAZOzxAdBa%3Alocalhost%3A9999/ban: 403 Forbidden -- {"errcode":"M_FORBIDDEN","error":"You don't have permission to ban"}

When possessing the power level to ban, this error message is inaccurate and confusing to users with clients that pass through some error messages from Synapse to the user (e.g. Mjolnir/Draupnir and Nheko).

Steps to reproduce

  • have a room with two moderators
  • try to ban the other moderator by calling /_matrix/client/v3/rooms//ban
  • you will receive a standard matrix error response with this text in the body.

Instead it should say something like:

"You don't have permission to ban this user" or "You don't have a high enough power level to ban this user".

Homeserver

localhost

Synapse Version

{"server_version":"1.90.0","python_version":"3.11.4"}

Installation Method

Docker (matrixdotorg/synapse)

Database

PostgreSQL

Workers

Single process

Platform

NA

Configuration

No response

Relevant log output

NA

Anything else that would be useful to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions