Sha256: cc5257c9b6cc6a5933266c028f5c3cd712774228293b97524435512cea023a48

Contents?: true

Size: 1.64 KB

Versions: 3

Compression:

Stored size: 1.64 KB

Contents

class Admin < Padrino::Application
  configure do
    ##
    # Application-specific configuration options
    # 
    # set :raise_errors, true     # Show exceptions (default for development)
    # set :public, "foo/bar"      # Location for static assets (default root/public)
    # set :sessions, false        # Enabled by default
    # set :reload, false          # Reload application files (default in development)
    # set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
    # set :locale_path, "bar"     # Set path for I18n translations (default your_app/locales)
    # enable :autolocale          # Auto Set locale if url match /:lang/foo/bar (disabled by default)
    # disable :padrino_helpers    # Disables padrino markup helpers (enabled by default if present)
    # disable :padrino_mailer     # Disables padrino mailer (enabled by default if present)
    # disable :flash              # Disables rack-flash (enabled by default)
    # enable  :authentication     # Enable padrino-admin authentication (disabled by default)
    # layout :foo                 # Layout can be in views/layouts/foo.ext or views/foo.ext (:application is default)
    # 
    layout false
    enable  :authentication
    disable :store_location
    set :login_page, "/<%= @app_path %>/sessions/new"

    access_control.roles_for :any do |role|
      role.allow "/sessions"
    end

    access_control.roles_for :admin do |role, account|

      role.allow "/"

      role.project_module :accounts do |project|
        project.menu :list, "/<%= @app_path %>/accounts.js"
        project.menu :new,  "/<%= @app_path %>/accounts/new"
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
padrino-admin-0.7.9 lib/padrino-admin/generators/app/app.rb.tt
padrino-admin-0.7.8 lib/padrino-admin/generators/app/app.rb.tt
padrino-admin-0.7.7 lib/padrino-admin/generators/app/app.rb.tt