5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-26 06:31:36 +00:00
matterbridge/vendor/layeh.com/gumble/gumble/permission.go
2020-10-01 22:50:56 +02:00

34 lines
748 B
Go

package gumble
// Permission is a bitmask of permissions given to a certain user.
type Permission int
// Permissions that can be applied in any channel.
const (
PermissionWrite Permission = 1 << iota
PermissionTraverse
PermissionEnter
PermissionSpeak
PermissionMuteDeafen
PermissionMove
PermissionMakeChannel
PermissionLinkChannel
PermissionWhisper
PermissionTextMessage
PermissionMakeTemporaryChannel
)
// Permissions that can only be applied in the root channel.
const (
PermissionKick Permission = 0x10000 << iota
PermissionBan
PermissionRegister
PermissionRegisterSelf
)
// Has returns true if the Permission p contains Permission o has part of its
// bitmask.
func (p Permission) Has(o Permission) bool {
return p&o == o
}