module Portier::Implants::ActionControllerImplant

*************************************************************************************

Insert methods in the Action Controller of a Rails project.

*************************************************************************************

Public Instance Methods

access_denied_message() click to toggle source
# File lib/portier/implants/action_controller_implant.rb, line 13
def access_denied_message
  @portier.access_denied_message
end
can?(action, object, options={}) click to toggle source
# File lib/portier/implants/action_controller_implant.rb, line 17
def can?(action, object, options={})
  @portier.can? action, object, options
end
can_view?(tag, options={}) click to toggle source
# File lib/portier/implants/action_controller_implant.rb, line 21
def can_view?(tag, options={})
  @portier.can_view? tag, options
end
permitted_params() click to toggle source
# File lib/portier/implants/action_controller_implant.rb, line 25
def permitted_params
  @portier.permitted_params
end
protect_app() click to toggle source
# File lib/portier/implants/action_controller_implant.rb, line 29
def protect_app
  @portier = Portier::Base.new(self, current_user)
  @portier.authorize_action
end
render_access_denied() click to toggle source
# File lib/portier/implants/action_controller_implant.rb, line 34
def render_access_denied
  render plain: "access_denied", status: 401
end