Implement authorization (part 2)