nicer way to handle permissions