Skip key sharing IsInPortal check if user is admin

This commit is contained in:
Tulir Asokan 2020-09-25 21:33:55 +03:00
parent 34163859f0
commit f88abe98bf

View file

@ -107,7 +107,7 @@ func (helper *CryptoHelper) allowKeyShare(device *crypto.DeviceIdentity, info ev
return &crypto.KeyShareRejection{Code: event.RoomKeyWithheldUnavailable, Reason: "Requested room is not a portal room"}
}
user := helper.bridge.GetUserByMXID(device.UserID)
if !user.IsInPortal(portal.Key) {
if !user.Admin && !user.IsInPortal(portal.Key) {
helper.log.Debugfln("Rejecting key request for %s from %s/%s: user is not in portal", info.SessionID, device.UserID, device.DeviceID)
return &crypto.KeyShareRejection{Code: event.RoomKeyWithheldUnauthorized, Reason: "You're not in that portal"}
}