Sha256: 832b359ee6b0b0e8f2b6ee2dbbb2d3c3a062cf1a145d2db5b508b14a48b452f8

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

require 'active_support'
# TODO would it be possible to put the require fedora in an after_initialize block like this?
#ActiveSupport.on_load(:after_initialize) do
# This would allow solrizer to load it's config files after the rails logger is up.
require 'active-fedora'
require 'cancan'

module Hydra
  extend ActiveSupport::Autoload
  autoload :User
  autoload :AccessControlsEnforcement
  autoload :PolicyAwareAccessControlsEnforcement
  autoload :AccessControlsEvaluation
  autoload :Ability
  autoload :Datastream
  autoload :PolicyAwareAbility
  autoload :AdminPolicy
  autoload :RoleMapperBehavior

  module ModelMixins
    extend ActiveSupport::Autoload
    autoload :RightsMetadata
  end

  # This error is raised when a user isn't allowed to access a given controller action.
  # This usually happens within a call to AccessControlsEnforcement#enforce_access_controls but can be
  # raised manually.
  class AccessDenied < ::CanCan::AccessDenied; end

end
ActiveSupport.on_load(:after_initialize) do
  # Enable the ability class in the local application to load before the ability class provided by hydra-access-controls
  require 'ability'
end
require 'role_mapper'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hydra-access-controls-5.0.0.pre14 lib/hydra-access-controls.rb
hydra-access-controls-5.0.0.pre13 lib/hydra-access-controls.rb
hydra-access-controls-5.0.0.pre12 lib/hydra-access-controls.rb
hydra-access-controls-5.0.0.pre11 lib/hydra-access-controls.rb
hydra-access-controls-5.0.0.pre10 lib/hydra-access-controls.rb