Improvements to the permissions framework