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.



41
42
43
44
# File 'app/api/core/abilities.rb', line 41

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

Instance Method Details

#can?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'app/api/core/abilities.rb', line 46

def can?(...)
  application.can?(...) or user.can?(...)
end