package legacyperm

import (
	"strings"

	"code.justin.tv/beefcake/server/rpc/beefcake"
)

type sortableLegacyPermissions []*beefcake.GetLegacyPermissionsResponse_LegacyPermission

func (sr sortableLegacyPermissions) Len() int { return len(sr) }
func (sr sortableLegacyPermissions) Less(i, j int) bool {
	return strings.Compare(sr[i].GetId(), sr[j].GetId()) < 0
}
func (sr sortableLegacyPermissions) Swap(i, j int) { sr[i], sr[j] = sr[j], sr[i] }
