func (connInfo *ConnInfo) HasPerm(channel string, flag string) (bool, error) {
	if !connInfo.loggedIn {
		return false, nil
	}
	owner, err := connInfo.mel.Database.IsUserOwner(connInfo.username)
	if err != nil {
		return false, err
	}
	if owner {
		return true, nil
	}
	has, err := connInfo.mel.Database.HasFlag(connInfo.username, channel, flag)
	return has, err
}
HasPerm - checks if the given connection has the given permission
package main
import (
	"fmt"
	"runtime/debug"
	"sync"
	"github.com/apex/log"
	"github.com/gorilla/websocket"
)
type ConnInfo struct {
	mel           *Melodious
	connection    *websocket.Conn
	messageStream chan<- BaseMessage
	subscriptions *sync.Map
	loggedIn      bool
	username      string
}
func (connInfo *ConnInfo) HasFlag(channel string, flag string) (bool, error) {
	if !connInfo.loggedIn {
		return false, nil
	}
	has, err := connInfo.mel.Database.HasFlag(connInfo.username, channel, flag)
	return has, err
}