Module: Hydra::User

Defined in:
lib/hydra/user.rb

Overview

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.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
9
# File 'lib/hydra/user.rb', line 6

def self.included(klass)
  # Other modules to auto-include
  klass.extend(ClassMethods)
end

Instance Method Details

#groupsObject



17
18
19
# File 'lib/hydra/user.rb', line 17

def groups
  RoleMapper.roles(self)
end

#user_keyObject

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.



13
14
15
# File 'lib/hydra/user.rb', line 13

def user_key
  send(Devise.authentication_keys.first)
end