Module: Hydra::AccessControlsEnforcement

Extended by:
ActiveSupport::Concern
Includes:
Blacklight::AccessControls::Enforcement
Defined in:
lib/hydra/access_controls_enforcement.rb

Instance Method Summary collapse

Instance Method Details

#current_abilityObject



5
6
7
# File 'lib/hydra/access_controls_enforcement.rb', line 5

def current_ability
  @current_ability || (scope.current_ability if scope&.respond_to?(:current_ability))
end

#with_ability(ability) ⇒ Object



9
10
11
12
13
# File 'lib/hydra/access_controls_enforcement.rb', line 9

def with_ability(ability)
  params_will_change!
  @current_ability = ability
  self
end

#with_discovery_permissions(permissions) ⇒ Object



15
16
17
18
19
# File 'lib/hydra/access_controls_enforcement.rb', line 15

def with_discovery_permissions(permissions)
  params_will_change!
  @discovery_permissions = Array(permissions)
  self
end