Skip to content

Instantly share code, notes, and snippets.

@cypok
Created February 22, 2009 18:56
Show Gist options
  • Save cypok/68568 to your computer and use it in GitHub Desktop.
Save cypok/68568 to your computer and use it in GitHub Desktop.
class GalleriesController < ApplicationController
include GalleriesHelper
before_filter :find_gallery, :only => [:edit, :show, :update, :destroy]
before_filter :find_parent, :only => [:new_gallery, :new, :create]
access_control do
allow all, :to => [:index, :show]
allow :admin, :to => [:new_root, :new, :create, :edit, :update, :destroy]
allow :moderator, :of => :gallery, :to => [:edit, :update, :destroy]
allow :moderator, :of => :parent, :to => [:new, :create]
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment