func (result *ResultSet) HasAllOf(rights ...string) bool {
	registry := map[string]bool{}
	total := len(rights)
	resolve := func(right string) bool {
		if !registry[right] {
			total = total - 1
		}
		registry[right] = true
		if total == 0 {
			return true
		}
		return false
	}
	for _, right := range rights {
		for _, role := range result.Matches {
			if role.Has(right) && resolve(right) {
				return true
			}
		}
	}
	return false
}
HasAllOf verifies that all specified rights are present.
package acl
type ResultSet struct {
	Matches map[string]*Role
}
func NewResultSet(roles ...*Role) *ResultSet {
	var matches = map[string]*Role{}
	for _, role := range roles {
		matches[role.Id] = role
	}
	return &ResultSet{
		Matches: matches,
	}
}
func (result *ResultSet) HasRole(id string) bool {
	if _, exists := result.Matches[id]; exists {
		return true
	}
	return false
}
func (result *ResultSet) GetRole(id string) *Role {
	if result.HasRole(id) {
		return result.Matches[id]
	}
	return nil
}
func (result *ResultSet) Has(right string) bool {
	for _, role := range result.Matches {
		if role.Has(right) {
			return true
		}
	}
	return false
}
func (result *ResultSet) HasOneOf(rights ...string) bool {
	for _, right := range rights {
		for _, role := range result.Matches {
			if role.Has(right) {
				return true
			}
		}
	}
	return false
}