Actually using the new permissions checks.

This is the final bit of the new permissions changes, where the new permission functions replace the previous checks.