README.md in rbacan-0.1.0 vs README.md in rbacan-0.1.1

- old
+ new

@@ -1,8 +1,8 @@ # Rbacan -a Role-based access control tool to manipulate user access to the functionnalities of your application +a Role-based access control tool to control user access to the functionnalities of your application ## Installation Add this line to your application's Gemfile: @@ -18,15 +18,25 @@ $ gem install rbacan ## Usage +```ruby run rails generate rbacan:install +``` copy the content in the generated file db/copy_to_seed.rb in your seeds.rb file you have there all the tools you need to create you roles and permissions +You might need to configure you user class_name if you're using a different class_name for the user, go to rbacan.rb in your initializers folder and make your change + +```ruby + Rbacan.configure do |config| + config.permittable_class = "YOUR USER CLASS_NAME" + end +``` + if you want to assign a role to a user it is simple you just have to do so: user = current_user user.assign_role(role_name) @@ -42,21 +52,26 @@ add this line to your user model: include Rbacan::Permittable run: + +```ruby rails db:migrate + rails db:seed +``` enjoy :D + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/hamdi777/rbacan. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/hamdi777/RBACan. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).