lib/proxes/policies/search_policy.rb in proxes-0.9.13 vs lib/proxes/policies/search_policy.rb in proxes-0.10.1

- old
+ new

@@ -2,12 +2,16 @@ require 'ditty/policies/application_policy' module ProxES class SearchPolicy < Ditty::ApplicationPolicy + def list? + search? + end + def search? - user && user.super_admin? + user end def fields? search? end @@ -20,10 +24,10 @@ search? end class Scope < Ditty::ApplicationPolicy::Scope def resolve - user && user.super_admin? ? scope : scope.where(id: -1) + user&.super_admin? ? scope : scope.where(id: -1) end end end end