All players have the empty string permission
parent
ce6a8413b1
commit
6f2d293f12
5
perms.go
5
perms.go
|
@ -21,7 +21,10 @@ func (cc *ClientConn) Perms() []string {
|
||||||
// HasPerms returns true if the ClientConn has all
|
// HasPerms returns true if the ClientConn has all
|
||||||
// of the specified permissions. Otherwise it returns false.
|
// of the specified permissions. Otherwise it returns false.
|
||||||
func (cc *ClientConn) HasPerms(want ...string) bool {
|
func (cc *ClientConn) HasPerms(want ...string) bool {
|
||||||
has := make(map[string]struct{})
|
has := map[string]struct{}{
|
||||||
|
"": struct{}{},
|
||||||
|
}
|
||||||
|
|
||||||
for _, perm := range cc.Perms() {
|
for _, perm := range cc.Perms() {
|
||||||
has[perm] = struct{}{}
|
has[perm] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue