Class: Ditty::IdentityPolicy::Scope

Inherits:
ApplicationPolicy::Scope show all
Defined in:
lib/ditty/policies/identity_policy.rb

Instance Attribute Summary

Attributes inherited from ApplicationPolicy::Scope

#scope, #user

Instance Method Summary collapse

Methods inherited from ApplicationPolicy::Scope

#initialize

Constructor Details

This class inherits a constructor from Ditty::ApplicationPolicy::Scope

Instance Method Details

#resolveObject



24
25
26
27
28
29
30
# File 'lib/ditty/policies/identity_policy.rb', line 24

def resolve
  if user.super_admin?
    scope
  else
    scope.where(id: -1)
  end
end