code: func mergeGrants(grantsLists ...[]*messages.Acl) *GrantsByRole {
  	all := map[messages.Acl_Role]stringset.Set{
  		messages.Acl_OWNER:     stringset.New(maxGrantsPerJob),
  		messages.Acl_TRIGGERER: stringset.New(maxGrantsPerJob),
  		messages.Acl_READER:    stringset.New(maxGrantsPerJob),
  	}
  	for _, grantsList := range grantsLists {
  		for _, g := range grantsList {
  			all[g.GetRole()].Add(g.GetGrantedTo())
  		}
  	}
  	sortedSlice := func(s stringset.Set) []string {
  		r := s.ToSlice()
  		sort.Strings(r)
  		return r
  	}
  	return &GrantsByRole{
  		Owners:     sortedSlice(all[messages.Acl_OWNER]),
  		Triggerers: sortedSlice(all[messages.Acl_TRIGGERER]),
  		Readers:    sortedSlice(all[messages.Acl_READER]),
  	}
  }
docs: // mergeGrants merges valid grants into GrantsByRole, removing and sorting duplicates.