Sha256: b4e43527c5c3542119cc5b84c70391ab591cc84a20ea5a3920f0ef551204c596
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
# 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. require 'deprecation' module Hydra::User extend Deprecation 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 as defined by devise. # The unique identifier is what access controls will be enforced against. def user_key send(Devise.authentication_keys.first) 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 deprecation_deprecate :unique_id # For backwards compatibility with the Rails2 User models in Hydra/Blacklight def login return unique_id end deprecation_deprecate :login end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hydra-head-4.1.0 | lib/hydra/user.rb |