Class: Maestrano::Connector::Rails::ApplicationPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
app/policies/maestrano/connector/rails/application_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.



51
52
53
54
# File 'app/policies/maestrano/connector/rails/application_policy.rb', line 51

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

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



49
50
51
# File 'app/policies/maestrano/connector/rails/application_policy.rb', line 49

def scope
  @scope
end

#userObject (readonly)

Returns the value of attribute user.



49
50
51
# File 'app/policies/maestrano/connector/rails/application_policy.rb', line 49

def user
  @user
end

Instance Method Details

#resolveObject



56
57
58
# File 'app/policies/maestrano/connector/rails/application_policy.rb', line 56

def resolve
  scope_to_tenant
end

#scope_to_tenantObject



60
61
62
# File 'app/policies/maestrano/connector/rails/application_policy.rb', line 60

def scope_to_tenant
  scope.where(tenant: user)
end