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

issue_type_helpers.rb « issues « concerns « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6ac08a567d431ba15030fdf97aca7793e76c90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

module Issues
  module IssueTypeHelpers
    # @param object [Issue, Project]
    # @param issue_type [String, Symbol]
    def create_issue_type_allowed?(object, issue_type)
      WorkItems::Type.base_types.key?(issue_type.to_s) &&
        can?(current_user, :"create_#{issue_type}", object)
    end
  end
end