public
Description: Rails plugin for generating role- and association-based permission checks on controllers and ActiveRecord models.
Home | Edit | New

For controllers

It works, but I want to write tests before I go deep here. Plus, it’s bedtime. Patience, grasshopper.

Funny how I’m documenting the controller side of acts_as_checkpoint last, when it came first (and is arguably neater)…

In the meantime, here’s an example.

class ProjectController < ApplicationController acts_as_checkpoint :get_user_method => :current_user, :if_denied => :access_denied controller_allows :worker_bee?, :to => [ :index, :show ] controller_allows :manager?, :to => [ :index, :show, :new, :create, :edit, :update ] controller_allows :admin?, :to => [ :index, :show, :destroy ] end
Last edited by blangenfeld, Thu Aug 14 00:31:04 -0700 2008
Home | Edit | New
Versions: