Module: Issues::IssueTypeHelpers

Included in:
BaseService, IssuesHelper
Defined in:
app/services/concerns/issues/issue_type_helpers.rb

Instance Method Summary collapse

Instance Method Details

#create_issue_type_allowed?(object, issue_type) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)

7
8
9
10
# File 'app/services/concerns/issues/issue_type_helpers.rb', line 7

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