mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Slightly better wording
This commit is contained in:
parent
6292df9c80
commit
b6f07431b6
|
|
@ -74,14 +74,16 @@ func SendRedaction(
|
||||||
if plEvent == nil {
|
if plEvent == nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 403,
|
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()
|
pl, err := plEvent.PowerLevels()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 403,
|
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
|
allowedToRedact = pl.UserLevel(device.UserID) >= pl.Redact
|
||||||
|
|
@ -89,7 +91,7 @@ func SendRedaction(
|
||||||
if !allowedToRedact {
|
if !allowedToRedact {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 403,
|
Code: 403,
|
||||||
JSON: jsonerror.Forbidden("cannot redact event"),
|
JSON: jsonerror.Forbidden("You don't have permission to redact this event, power level too low."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue