added NullPermissionManager for testing, refactoring