mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Jterzis/pull dendrite fork (#712)
Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com> Co-authored-by: Tak Wai Wong <tak@hntlabs.com> Co-authored-by: John Terzis <john@hntlabs.com>
This commit is contained in:
parent
e0a3d62205
commit
01b94a9803
|
|
@ -263,7 +263,7 @@ func Setup(
|
||||||
if !isAllowed {
|
if !isAllowed {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusUnauthorized,
|
Code: http.StatusUnauthorized,
|
||||||
JSON: jsonerror.Forbidden(""),
|
JSON: jsonerror.Forbidden("Unauthorised"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -352,6 +352,19 @@ func Setup(
|
||||||
return util.ErrorResponse(err)
|
return util.ErrorResponse(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isAllowedInviter, _ := authorization.IsAllowed(authz.AuthorizationArgs{
|
||||||
|
RoomId: vars["roomID"],
|
||||||
|
UserId: device.UserID,
|
||||||
|
Permission: authz.PermissionInvite,
|
||||||
|
})
|
||||||
|
|
||||||
|
if !isAllowedInviter {
|
||||||
|
return util.JSONResponse{
|
||||||
|
Code: http.StatusUnauthorized,
|
||||||
|
JSON: jsonerror.Forbidden("Inviter not allowed"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SendInvite(req, userAPI, device, vars["roomID"], cfg, rsAPI, asAPI)
|
return SendInvite(req, userAPI, device, vars["roomID"], cfg, rsAPI, asAPI)
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodPost, http.MethodOptions)
|
).Methods(http.MethodPost, http.MethodOptions)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue