Skip key sharing IsInPortal check if user is admin
This commit is contained in:
parent
34163859f0
commit
f88abe98bf
1 changed files with 1 additions and 1 deletions
|
@ -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"}
|
return &crypto.KeyShareRejection{Code: event.RoomKeyWithheldUnavailable, Reason: "Requested room is not a portal room"}
|
||||||
}
|
}
|
||||||
user := helper.bridge.GetUserByMXID(device.UserID)
|
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)
|
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"}
|
return &crypto.KeyShareRejection{Code: event.RoomKeyWithheldUnauthorized, Reason: "You're not in that portal"}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue