class ApplicationController
Public Instance Methods
is_owner(user_id)
click to toggle source
# File lib/generators/jwt_rails/templates/application_controller.rb, line 22 def is_owner user_id unless user_id == current_user.id render json: nil, status: :forbidden return end end
is_owner_object(data)
click to toggle source
# File lib/generators/jwt_rails/templates/application_controller.rb, line 29 def is_owner_object data if data.nil? or data.user_id.nil? return render status: :not_found else is_owner data.user_id end end
not_found()
click to toggle source
# File lib/generators/jwt_rails/templates/application_controller.rb, line 5 def not_found render json: { error: 'not_found' } end