refactored permissions to be more object oriented