Class: Archangel::ApplicationPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
app/policies/archangel/application_policy.rb

Overview

Nested scope resource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Policy scope initializer

Parameters:

  • user (Object)

    the user

  • scope (Object)

    the scope


121
122
123
124
# File 'app/policies/archangel/application_policy.rb', line 121

def initialize(user, scope)
  @user = user
  @scope = scope
end

Instance Attribute Details

#scopeObject (readonly)

Scope to check


108
109
110
# File 'app/policies/archangel/application_policy.rb', line 108

def scope
  @scope
end

#userObject (readonly)

User to check policy for


113
114
115
# File 'app/policies/archangel/application_policy.rb', line 113

def user
  @user
end

Instance Method Details

#resolveObject

Resolvable resources

Returns:

  • (Object)

    iteratable resource


131
132
133
# File 'app/policies/archangel/application_policy.rb', line 131

def resolve
  scope
end