optimize team_permissions query by using pluck

pluck allows us to extract fields directly from
a query without the need to instantiate model
objects (very expensive).
add spec to find the highest permission.
add methods to retrieve highest permission

- and use it for ssh-push access determination
- makes tests green.
Merge remote-tracking branch 'origin/599-fix_group_permissions_for_ssh' into staging