Sha256: 29beaea788e3c43ee0250a547cc5983a2ca1f397a68cef7c9c9c4f3c807520bc

Contents?: true

Size: 868 Bytes

Versions: 3

Compression:

Stored size: 868 Bytes

Contents

# will move to lib/hydra/access_control folder/namespace in release 5.x
# Injects behaviors into User model so that it will work with Hydra Access Controls
# By default, this module assumes you are using the User model created by Blacklight, which uses Devise.
# To integrate your own User implementation into Hydra, override this Module or define your own User model in app/models/user.rb within your Hydra head.
module Hydra::User
  
  def self.included(klass)
    # Other modules to auto-include
    klass.send(:include, Hydra::SuperuserAttributes)
  end

  # This method should display the unique identifier for this user
  # the unique identifier is what access controls will be enforced against. 
  def unique_id
    return to_s
  end

  # For backwards compatibility with the Rails2 User models in Hydra/Blacklight
  def login
    return unique_id
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hydra-head-4.0.3 lib/hydra/user.rb
hydra-head-4.0.2 lib/hydra/user.rb
hydra-head-4.0.1 lib/hydra/user.rb