You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.
class Ability
include Knock::Authenticable
include CanCan::Ability
def initialize(current_user)
if current_user.has_role? :admin
can :create, EligibleItem
end
end
end
app/controllers/application_controller.rb
class ApplicationController < ActionController::API
include Knock::Authenticable
rescue_from CanCan::AccessDenied do |exception|
render json: { error: 'You are not authorized to perfom this action' }, status: :forbidden
end
end