Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 1.27 KB

TheRoleGuiInstallation.md

File metadata and controls

79 lines (56 loc) · 1.27 KB

[ Back to TheRole ]


TheRole GUI Installation

http://localhost:3000/admin/roles
TheRole GUI

0. Gemfile

gem 'the_role', '~> 3.0.0'

or

gem 'the_role_api',              '~> 3.0.0'
gem 'the_role_management_panel', '~> 3.0.0'

and after that

bundle

1. Check TheRole initializer

config/initializers/the_role.rb

TheRole.configure do |config|
  # [ Devise => :authenticate_user! | Sorcery => :require_login ]
  config.login_required_method = :authenticate_user!

  # layout for Management panel
  config.layout = :the_role_management_panel

  # ... code ...
end

2. Add Routing mixin

config/config/routes.rb

RailsApp::Application.routes.draw do
  # ... code ...

  TheRoleManagementPanel::Routes.mixin(self)
end

3. Add link to TheRole Manage Panel

HAML

- if current_user
  - if current_user.admin? || current_user.moderator?(:roles)
    = link_to 'TheRole Manage Panel',  admin_roles_path

[ Back to TheRole ]