Sha256: 55f71d3623132f55bdadf9b881c34f31c1858e430f41f2088ab0b6ccc7a7e9ee
Contents?: true
Size: 547 Bytes
Versions: 6
Compression:
Stored size: 547 Bytes
Contents
# frozen_string_literal: true module Motor class ApiBaseController < ActionController::API include Motor::CurrentUserMethod class CanCanAbilityManageAll include CanCan::Ability def initialize(_) can :manage, :all end end unless Rails.env.test? rescue_from StandardError do |e| Rails.logger.error(e) render json: { errors: [e.message] }, status: :internal_server_error end end def current_ability CanCanAbilityManageAll.new(current_user) end end end
Version data entries
6 entries across 6 versions & 1 rubygems