Sha256: 575de8aa09c2cb2d98c5c8fa6c876f80a06df79378258a8640fc8da126ed9f6e

Contents?: true

Size: 1.43 KB

Versions: 9

Compression:

Stored size: 1.43 KB

Contents

require "arrthorizer/version"

module Arrthorizer
  autoload :ArrthorizerException,     "arrthorizer/arrthorizer_exception"

  autoload :Registry,                 "arrthorizer/registry"

  autoload :Role,                     "arrthorizer/role"
  autoload :ContextRole,              "arrthorizer/context_role"
  autoload :Group,                    "arrthorizer/group"

  autoload :Permission,               "arrthorizer/permission"
  autoload :Privilege,                "arrthorizer/privilege"

  autoload :ContextBuilder,           "arrthorizer/context_builder"

  autoload :Rails,                    "arrthorizer/rails"

  require 'arrthorizer/context'
  require 'arrthorizer/roles'

  if defined?(::Rails)
    Arrthorizer::Rails.initialize!
  end

  def self.configure(&block)
    self.instance_eval(&block)
  end

  ##
  # Inject a dependency for Arrthorizer's Groups feature.
  # The provided object needs to be able to respond_to :is_member_of?
  # The is_member_of? function is expected to return a boolean-like
  # object which represents whether or not the user is a member of the
  # provided Group
  def self.check_group_membership_using(object)
    if object.respond_to?(:is_member_of?)
      @membership_service = object
    else
      raise "Arrthorizer cannot check role membership using #{object.inspect}"
    end
  end

  def self.membership_service
    @membership_service
  end

  if defined?(RSpec)
    require 'arrthorizer/rspec'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
arrthorizer-0.4.2 lib/arrthorizer.rb
arrthorizer-0.4.1 lib/arrthorizer.rb
arrthorizer-0.3.2 lib/arrthorizer.rb
arrthorizer-0.3.1 lib/arrthorizer.rb
arrthorizer-0.3.0 lib/arrthorizer.rb
arrthorizer-0.2.1 lib/arrthorizer.rb
arrthorizer-0.2.0 lib/arrthorizer.rb
arrthorizer-0.1.3 lib/arrthorizer.rb
arrthorizer-0.1.2 lib/arrthorizer.rb