merge_request_command.rb 337 Bytes
Newer Older
1 2 3
module Gitlab
  module ChatCommands
    class MergeRequestCommand < BaseCommand
4 5
      def self.available?(project)
        project.merge_requests_enabled?
6 7 8 9 10 11 12 13 14 15 16 17
      end

      def collection
        project.merge_requests
      end

      def readable?(_)
        can?(current_user, :read_merge_request, project)
      end
    end
  end
end