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
[:destroy] => :destroyable_notes
}
end
Because this pattern is so common, Consul now has a shortcut :crud
to do the same:
class NotesController < ApplicationController
power :crud => :notes
end
Posted by Henning Koch to makandra dev (2012-07-04 09:08)