Class: Core::Abilities::CompositeAbility
- Inherits:
-
Object
- Object
- Core::Abilities::CompositeAbility
- Defined in:
- app/api/core/abilities.rb
Overview
:nodoc:
Instance Method Summary collapse
- #can? ⇒ Boolean
-
#initialize(request) ⇒ CompositeAbility
constructor
A new instance of CompositeAbility.
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
46 47 48 |
# File 'app/api/core/abilities.rb', line 46 def can?(...) application.can?(...) or user.can?(...) end |