mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
fix control give for users.
This commit is contained in:
@@ -40,6 +40,15 @@ func HostsOnly(w http.ResponseWriter, r *http.Request) (context.Context, error)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func HostsOrAdminsOnly(w http.ResponseWriter, r *http.Request) (context.Context, error) {
|
||||
session, ok := GetSession(r)
|
||||
if !ok || (!session.IsHost() && !session.Profile().IsAdmin) {
|
||||
return nil, utils.HttpForbidden("session is not host or admin")
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func CanWatchOnly(w http.ResponseWriter, r *http.Request) (context.Context, error) {
|
||||
session, ok := GetSession(r)
|
||||
if !ok || !session.Profile().CanWatch {
|
||||
|
||||
Reference in New Issue
Block a user