Sha256: 44dc50b0ac6c3957a827276d00e938c5d9f9081d915d89a41ea8e8ef1a495782

Contents?: true

Size: 374 Bytes

Versions: 16

Compression:

Stored size: 374 Bytes

Contents

class LocationPolicy < ApplicationPolicy
  def index?
    @user
  end

  def show?
    @user
  end

  def update?
    @user && @user.superuser?
  end

  def create?
    @user && @user.superuser?
  end

  def destroy?
    @user && @user.superuser?
  end

  class Scope < ApplicationPolicy::Scope
    def resolve
      scope.where(parent_location_id: nil)
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
introspective_grape-0.6.1 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.5.7 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.5.6 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.5.5 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.5.4 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.5.2 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.5.0 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.4.3 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.4.2 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.4.1 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.4.0 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.3.9 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.3.7 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.3.6 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.3.5 spec/dummy/app/policies/location_policy.rb
introspective_grape-0.3.3 spec/dummy/app/policies/location_policy.rb