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

@ -39,6 +39,10 @@ func (h *RoomHandler) controlRequest(w http.ResponseWriter, r *http.Request) err
}
session, _ := auth.GetSession(r)
if h.sessions.Settings().LockedControls && !session.Profile().IsAdmin {
return utils.HttpForbidden("controls are locked")
}
h.sessions.SetHost(session)
return utils.HttpSuccess(w)