Skip to content

Instantly share code, notes, and snippets.

@be9
Created June 12, 2009 13:45
Show Gist options
  • Save be9/128641 to your computer and use it in GitHub Desktop.
Save be9/128641 to your computer and use it in GitHub Desktop.
module Acl9
module ControllerExtensions
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
# Create an access control block in the controller.
#
# @overload access_control(options, &block)
# Translates given ACL +block+ to a lambda, raising
# {Acl9::AccessDenied} exception on occasion, and installs it with
# +before_filter+.
#
# @param [Hash] options the options
#
# @overload access_control(method_name, options, &block)
# Adds given ACL +block+ to the controller as a method.⋅
#
# @param [Symbol] method_name method name to add.
# @param [Hash] options the options
def access_control(*args, &block)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment