There is no need to do setup_user_auth and authorize for the same action

This commit is contained in:
Tom Hughes 2022-07-08 09:48:00 +01:00
parent 679f442470
commit 1a4faa4507

View file

@ -2,7 +2,7 @@ module Api
class NotesController < ApiController class NotesController < ApiController
before_action :check_api_readable before_action :check_api_readable
before_action :check_api_writable, :only => [:create, :comment, :close, :reopen, :destroy] before_action :check_api_writable, :only => [:create, :comment, :close, :reopen, :destroy]
before_action :setup_user_auth, :only => [:create, :comment, :show] before_action :setup_user_auth, :only => [:create, :show]
before_action :authorize, :only => [:close, :reopen, :destroy, :comment] before_action :authorize, :only => [:close, :reopen, :destroy, :comment]
authorize_resource authorize_resource