README.md in consul-0.10.2 vs README.md in consul-0.11.0
- old
+ new
@@ -1,9 +1,9 @@
Consul - A next gen authorization solution
==========================================
-[![Build Status](https://secure.travis-ci.org/makandra/consul.png?branch=master)](https://travis-ci.org/makandra/consul)
+[![Build Status](https://secure.travis-ci.org/makandra/consul.png?branch=master)](https://travis-ci.org/makandra/consul) [![Code Climate](https://codeclimate.com/github/makandra/consul.png)](https://codeclimate.com/github/makandra/consul)
Consul is a authorization solution for Ruby on Rails where you describe *sets of accessible things* to control what a user can see or edit.
We have used Consul in combination with [assignable_values](https://github.com/makandra/assignable_values) to solve a variety of authorization requirements ranging from boring to bizarre.
Also see our crash course video: [Solving bizare authorization requirements with Rails](http://bizarre-authorization.talks.makandra.com/).
@@ -368,12 +368,12 @@
Note that in moderately complex authorization scenarios you will often find yourself writing a map like this:
class NotesController < ApplicationController
power :notes, :map => {
- [:edit, :update] => :updatable_notes
- [:new, :create] => :creatable_notes
+ [:edit, :update] => :updatable_notes,
+ [:new, :create] => :creatable_notes,
[:destroy] => :destroyable_notes
}
end
Because this pattern is so common, there is a shortcut `:crud` to do the same:
@@ -698,12 +698,14 @@
Power.with_power(admin) do
# run code that uses Power.current
end
+There is also a method `.without_power` that runs a block without a current Power:
-
-
+ Power.without_power do
+ # run code that should not see a Power
+ end
Installation
------------