class ApiValve::PermissionHandler

Attributes

env[R]
options[R]

Public Class Methods

new(env, options = {}) click to toggle source
# File lib/api_valve/permission_handler.rb, line 3
def initialize(env, options = {})
  @env = env
  @options = options.with_indifferent_access
end

Public Instance Methods

allowed?() click to toggle source

Run permission checks Simple implementation is always true. Override in your implementation.

# File lib/api_valve/permission_handler.rb, line 10
def allowed?
  true
end
message() click to toggle source

Returns string message why access was denied Rendered on the API. Override in your implementation.

# File lib/api_valve/permission_handler.rb, line 17
def message
  'Insufficient permissions'
end