add locked controls to settings.

This commit is contained in:
Miroslav Šedivý 2023-05-14 22:41:32 +02:00
parent b8fccc4d07
commit cf4e0666fe
4 changed files with 19 additions and 0 deletions

View file

@ -40,6 +40,10 @@ func (h *MessageHandlerCtx) controlRequest(session types.Session) error {
return ErrIsAlreadyTheHost
}
if h.sessions.Settings().LockedControls && !session.Profile().IsAdmin {
return ErrIsNotAllowedToHost
}
if !h.sessions.Settings().ImplicitHosting {
// tell session if there is a host
if host, hasHost := h.sessions.GetHost(); hasHost {