From b6f07431b6be22388937e94b0cd876d68c085a85 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 3 Jul 2020 17:24:35 +0100 Subject: [PATCH] Slightly better wording --- clientapi/routing/redaction.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clientapi/routing/redaction.go b/clientapi/routing/redaction.go index 84d3454b8..fd80e0ab4 100644 --- a/clientapi/routing/redaction.go +++ b/clientapi/routing/redaction.go @@ -74,14 +74,16 @@ func SendRedaction( if plEvent == nil { return util.JSONResponse{ Code: 403, - JSON: jsonerror.Forbidden("cannot redact event, missing pl event"), + JSON: jsonerror.Forbidden("You don't have permission to redact this event, no power_levels event in this room."), } } pl, err := plEvent.PowerLevels() if err != nil { return util.JSONResponse{ Code: 403, - JSON: jsonerror.Forbidden("cannot redact event, malformed pl event"), + JSON: jsonerror.Forbidden( + "You don't have permission to redact this event, the power_levels event for this room is malformed so auth checks cannot be performed.", + ), } } allowedToRedact = pl.UserLevel(device.UserID) >= pl.Redact @@ -89,7 +91,7 @@ func SendRedaction( if !allowedToRedact { return util.JSONResponse{ Code: 403, - JSON: jsonerror.Forbidden("cannot redact event"), + JSON: jsonerror.Forbidden("You don't have permission to redact this event, power level too low."), } }