code: func MakeRuleSet(rules []Rule) RuleSet {
  	set := make(RuleSet)
  	for _, rule := range rules {
  		for _, resource := range rule.Resources {
  			rules, ok := set[resource]
  			if !ok {
  				set[resource] = []Rule{rule}
  			} else {
  				rules = append(rules, rule)
  				set[resource] = rules
  			}
  		}
  	}
  	for resource := range set {
  		rules := set[resource]
  		// sort rules by most specific rule, the rule that has actions
  		// is more specific than the one that has no actions
  		sort.Slice(rules, func(i, j int) bool {
  			return rules[i].IsMoreSpecificThan(rules[j])
  		})
  		set[resource] = rules
  	}
  	return set
  }
docs: // MakeRuleSet converts slice of rules to the set of rules