Sha256: 69689a9a2d0d9a2a242514c02392001d0cf0ad1fdd37171b715d00c152a0c575
Contents?: true
Size: 519 Bytes
Versions: 31
Compression:
Stored size: 519 Bytes
Contents
# frozen_string_literal: true module Motor class ApiBaseController < ActionController::API def current_user if defined?(current_admin) current_admin elsif defined?(current_admin_user) current_admin_user elsif defined?(super) super end end def current_ability klass = Class.new klass.include(CanCan::Ability) klass.define_method(:initialize) do |_user| can :manage, :all end klass.new(current_user) end end end
Version data entries
31 entries across 31 versions & 1 rubygems