refactor permission class - however failing tests