Consul 0.3.0 has a shortcut to quickly create an action map for CRUD controllers

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
Henning Koch Almost 12 years ago