// Figure out what permissions the given list of permissions gives to the named
// channel. Merges permissions so if you have e.g. read on "*" and write on "foo"
// You will have both read & write on "foo".
Figure out what permissions the given list of permissions gives to the named
channel. Merges permissions so if you have e.g. read on "*" and write on "foo"
You will have both read & write on "foo".
// Figure out what permissions the given list of permissions gives to the named // channel . Merges permissions so if you have e . g . read on " * " and write on " foo " // You will have both read & write on " foo " .
func GetChannelPermissions(name string, permissions Permissions) (read bool, write bool) {
	read = false
	write = false
	for k, p := range permissions {
		if channelMatch(name, k) {
			if p.Read {
				read = true
			}
			if p.Write {
				write = true
			}
		}
	}
	return read, write
}
func GetChannelPermissions ( name string , permissions Permissions ) ( read bool , write bool ) { read = false write = false for k , p := range permissions { if channelMatch ( name , k ) { if p . Read { read = true } if p . Write { write = true } } } return read , write }
Figure out what permissions the given list of permissions gives to the named
channel.
Figure out what permissions the given list of permissions gives to the named channel .