Sha256: 53ea78562b7864c48e080dd3826ff401884f92125250b5619ae62c357d194103

Contents?: true

Size: 790 Bytes

Versions: 4

Compression:

Stored size: 790 Bytes

Contents

module MixRailsAuth
  class Engine < ::Rails::Engine
    
    config.generators do |g|                                                               
      g.test_framework :rspec
      g.integration_tool :rspec
    end

    def navigation
      if defined? Admix
        Admix::Navigation::NavBar.post_menu do
          Admix::Navigation::NavBar.find(:general) do |menu|
            menu.submenu do |submenu|
              submenu.key   = :users
              submenu.title = I18n.t 'users.users'
              submenu.url   = 'admix_users_url'

              submenu.instance_eval do
                def can_render?(current_user)
                  current_user.has_role? :admin
                end
              end

            end
          end
        end
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mix-rails-0.23.1 mix-rails-auth/lib/mix-rails-auth/engine.rb
mix-rails-auth-0.23.1 lib/mix-rails-auth/engine.rb
mix-rails-0.23.0 mix-rails-auth/lib/mix-rails-auth/engine.rb
mix-rails-auth-0.23.0 lib/mix-rails-auth/engine.rb