Create authorized function for each controller