Sha256: 72305818d8f7810ce3989cfb0e53723ecd49ecd0a7363fececb993bccc68199e

Contents?: true

Size: 661 Bytes

Versions: 5

Compression:

Stored size: 661 Bytes

Contents

module Dummy
  class User < Kadmin::Auth::User
    def initialize(email, resources: [])
      super(email)
      @resources = resources
    end

    def authorized?(_request)
      return true
    end
  end

  class UserStore < Kadmin::Auth::UserStore
    def initialize
      super

      set('admin@test.com', Dummy::User.new('admin@test.com', resources: [:posts]))
    end
  end
end

Kadmin.config.logger = Rails.logger
Kadmin.config.mount_path = '/kadmin'

Kadmin::Auth.config.user_class = Dummy::User
Kadmin::Auth.config.user_store_class = Dummy::UserStore

Kadmin::Auth.config.enable!

Kadmin.config.navbar_links << { title: 'Test', path: '/admin/test' }

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kadmin-0.2.3 test/dummy/config/initializers/rails_admin.rb
kadmin-0.2.2 test/dummy/config/initializers/rails_admin.rb
kadmin-0.1.7 test/dummy/config/initializers/rails_admin.rb
kadmin-0.1.6 test/dummy/config/initializers/rails_admin.rb
kadmin-0.1.4 test/dummy/config/initializers/rails_admin.rb