Overhauled permissions.

Fixes #533.

Some of the permissions' groupings are somewhat awkward, so we should discuss them here.