func Resolver(groups []Group) CodeSetResultSet {
	if len(groups) == 0 {
		return nil
	}

	var groupsFound groupSet
	for _, config := range groups {

		if len(groupsFound) == 0 {
			newGroup := config
			groupsFound = append(groupsFound, &newGroup)
			continue
		}

		if config.isSatisfiedByAnyOf(groupsFound) {
			continue
		}

		group, found := groupsFound.firstCompatible(&config)
		if !found {
			newGroup := config
			groupsFound = append(groupsFound, &newGroup)
			continue
		}

		group.add(&config)
	}

	return mapToCodeSets(groups, groupsFound)
}
// Resolver find minimal codeSet required to satisfy a set Group of permissions (endpoints)
Resolver find minimal codeSet required to satisfy a set Group of permissions (endpoints)
// Resolver find minimal codeSet required to satisfy a set Group of permissions ( endpoints )
func Resolver(groups []Group) CodeSetResultSet {
	if len(groups) == 0 {
		return nil
	}
	var groupsFound groupSet
	for _, config := range groups {
		if len(groupsFound) == 0 {
			newGroup := config
			groupsFound = append(groupsFound, &newGroup)
			continue
		}
		if config.isSatisfiedByAnyOf(groupsFound) {
			continue
		}
		group, found := groupsFound.firstCompatible(&config)
		if !found {
			newGroup := config
			groupsFound = append(groupsFound, &newGroup)
			continue
		}
		group.add(&config)
	}
	return mapToCodeSets(groups, groupsFound)
}
func Resolver ( groups [ ] Group ) CodeSetResultSet { if len ( groups ) == 0 { return nil } var groupsFound groupSet for _ , config := range groups { if len ( groupsFound ) == 0 { newGroup := config groupsFound = append ( groupsFound , & newGroup ) continue } if config . isSatisfiedByAnyOf ( groupsFound ) { continue } group , found := groupsFound . firstCompatible ( & config ) if ! found { newGroup := config groupsFound = append ( groupsFound , & newGroup ) continue } group . add ( & config ) } return mapToCodeSets ( groups , groupsFound ) }
Resolver find minimal codeSet required to satisfy a set Group of permissions (endpoints)
Resolver find minimal codeSet required to satisfy a set Group of permissions ( endpoints )