sort is performed by db in #authorized_groups