module Dynamican::Authorization

Public Instance Methods

authorize!(action, item = nil) click to toggle source
# File lib/dynamican/authorization.rb, line 11
def authorize!(action, item = nil)
  raise UnauthorizedResource unless @current_user.can? action, item
end
unauthorized() click to toggle source
# File lib/dynamican/authorization.rb, line 15
def unauthorized
  render status: :unauthorized
end