Class: Core::Abilities::CompositeAbility

Inherits:
Object
  • Object
show all
Defined in:
app/api/core/abilities.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ CompositeAbility

Returns a new instance of CompositeAbility


39
40
41
42
# File 'app/api/core/abilities.rb', line 39

def initialize(request)
  @user, @application = User.new(request), Application.new(request)
  @application.authenticate!(@user)
end

Instance Method Details

#can?(*args, &block) ⇒ Boolean

Returns:

  • (Boolean)

44
45
46
# File 'app/api/core/abilities.rb', line 44

def can?(*args, &block)
  application.can?(*args, &block) or user.can?(*args, &block)
end