Sha256: 9a14c2f8f5d87a6a31c3f7cf4aff3cb49d00d240e4bf4bb2b392e943a7384ff5

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

module Georgia
  class PagePolicy < ApplicationPolicy

    include Georgia::Concerns::ContentPolicy
    include Georgia::Concerns::PublishingPolicy

    class Scope < Struct.new(:user, :scope)
      def resolve
        Georgia::Page.all
      end
    end

    def index?
      content_user_permissions(:show_pages).include?(true)
    end

    def create?
      content_user_permissions(:create_pages).include?(true)
    end

    def settings?
      content_user_permissions(:edit_page_settings).include?(true)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia-0.8.0 app/policies/georgia/page_policy.rb