Edited authorize method in application_controller.