Welcome to mirror list, hosted at ThFree Co, Russian Federation.

found_wiki_page.rb « search « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 99ca6a79fe2dce53ffb3bec692e7c600dec4bba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

# - rendering by using data purely from Elasticsearch and does not trigger Gitaly calls.
# - allows policy check
module Gitlab
  module Search
    class FoundWikiPage < SimpleDelegator
      attr_reader :wiki

      def self.declarative_policy_class
        'WikiPagePolicy'
      end

      # @param found_blob [Gitlab::Search::FoundBlob]
      def initialize(found_blob)
        super
        @wiki = found_blob.project.wiki
      end

      def to_ability_name
        'wiki_page'
      end
    end
  end
end