Added permissions tests.

Also added methods to get group permissions.