More permissions refactoring