BigW Consortium Gitlab

snippet_parser.rb 340 Bytes
Newer Older
1 2 3 4 5 6 7 8
module Banzai
  module ReferenceParser
    class SnippetParser < BaseParser
      self.reference_type = :snippet

      def references_relation
        Snippet
      end
9 10 11

      private

12 13
      def can_read_reference?(user, ref_project, node)
        can?(user, :read_project_snippet, referenced_by([node]).first)
14
      end
15 16 17
    end
  end
end