Sha256: eb5a60b5c367657c82f412cb90fe16703418e8dc462604855dd7dc6b988380c2

Contents?: true

Size: 545 Bytes

Versions: 7

Compression:

Stored size: 545 Bytes

Contents

module Acl9
  module Helpers
    def self.included(base)
      base.extend ClassMethods
    end

    module ClassMethods
      def access_control(method, opts = {}, &block)
        subject_method = opts.delete(:subject_method) || Acl9::config[:default_subject_method]
        raise ArgumentError, "Block must be supplied to access_control" unless block

        generator = Acl9::Dsl::Generators::HelperMethod.new(subject_method, method)

        generator.acl_block!(&block)
        generator.install_on(self, opts)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 6 rubygems

Version Path
be9-acl9-0.11.0 lib/acl9/helpers.rb
jeffleeismyhero-acl9-0.10.1 lib/acl9/helpers.rb
jeffleeismyhero-acl9-0.10.2 lib/acl9/helpers.rb
peterpunk-acl9-0.10.0 lib/acl9/helpers.rb
rurounijones-acl9-0.10.1 lib/acl9/helpers.rb
trydionel-acl9-0.11.01 lib/acl9/helpers.rb
acl9-0.11.0 lib/acl9/helpers.rb