Sha256: 4e0bfa91dbaa5ac590d73746e2dedbd4ac58f8c8a6b6d93238cde3c795913c4f
Contents?: true
Size: 1.3 KB
Versions: 2
Compression:
Stored size: 1.3 KB
Contents
## TheRole Gem for providing simple, but powerful and flexible role system for ROR3 applications. Based on Hashes. * Based on MVC semantik (easy to understand what's happening) * Realtime dynamically management with simple interface * Customizable ## Installation Gemfile ``` ruby gem 'the_role' gem 'haml' ``` ``` ruby bundle install ``` ``` ruby rake the_role_engine:install:migrations >> Copied migration 20111028145956_create_roles.rb from the_role_engine rake db:migrate ``` ``` ruby rake db:roles:create >> Administrator, Moderator of pages, User, Demo ``` ``` ruby user = User.first user.role = Role.where(:name => :demo).first user.save user.admin? => false user.moderator? :pages => false user.has_role? :pages, :index => true user.role = Role.where(:name => :moderator).first user.save user.admin? => false user.moderator? :pages => true user.has_role? :pages, :any_crazy_name => true user.role = Role.where(:name => :admin).first user.save user.admin? => true user.moderator? :pages => true user.moderator? :any_crazy_name => true user.has_role? :any_crazy_name, :any_crazy_name => true ``` Manage your roles you can with **admin_roles_path** => **http://localhost:3000/admin/roles** Copyright (c) 2011 [Ilya N. Zykin Github.com/the-teacher], released under the MIT license
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
the_role-1.1.0 | README.md |
the_role-1.0.0 | README.md |