mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
fix: correct LegacyIsHost boolean logic (#675)
* fix: broken LegacyIsHost method. * fix: improve LegacyIsHost logic for better access control.
This commit is contained in:
@@ -75,8 +75,14 @@ func (session *SessionCtx) IsHost() bool {
|
||||
|
||||
// only needed for legacy webrtc handler
|
||||
func (session *SessionCtx) LegacyIsHost() bool {
|
||||
implicitHosting := session.manager.Settings().ImplicitHosting
|
||||
return !(!implicitHosting && !session.manager.isHost(session)) || (implicitHosting && !session.profile.CanHost)
|
||||
settings := session.manager.Settings()
|
||||
if !session.profile.CanHost || session.PrivateModeEnabled() {
|
||||
return false
|
||||
}
|
||||
if settings.LockedControls && !session.profile.IsAdmin {
|
||||
return false
|
||||
}
|
||||
return settings.ImplicitHosting || session.manager.isHost(session)
|
||||
}
|
||||
|
||||
func (session *SessionCtx) SetAsHost() {
|
||||
|
||||
Reference in New Issue
Block a user