Refactoring

Refactor permissions policy to be more modular.