Commit 7aa551c2 authored by Jan Provaznik's avatar Jan Provaznik Committed by Florie Guibert

Add default_enabled param

Use default from YML config file for epic_boards feature flag.
parent 0531b906
......@@ -70,6 +70,6 @@ class Groups::EpicBoardsController < Groups::ApplicationController
end
def authorize_read_board!
access_denied! unless Feature.enabled?(:epic_boards, group) && can?(current_user, :read_epic_board, group)
access_denied! unless Feature.enabled?(:epic_boards, group, default_enabled: :yaml) && can?(current_user, :read_epic_board, group)
end
end
......@@ -50,7 +50,7 @@ module Mutations
board = authorized_find!(id: args[:board_id])
epic = authorized_find!(id: args[:epic_id])
unless Feature.enabled?(:epic_boards, board.resource_parent)
unless Feature.enabled?(:epic_boards, board.resource_parent, default_enabled: :yaml)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'epic_boards feature is disabled'
end
......
......@@ -24,7 +24,7 @@ module Mutations
def resolve(**args)
board = authorized_find!(id: args[:id])
unless Feature.enabled?(:epic_boards, board.resource_parent)
unless Feature.enabled?(:epic_boards, board.resource_parent, default_enabled: :yaml)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'epic_boards feature is disabled'
end
......
......@@ -16,7 +16,7 @@ module Resolvers
alias_method :group, :object
def resolve(id: nil)
return unless Feature.enabled?(:epic_boards, group)
return unless Feature.enabled?(:epic_boards, group, default_enabled: :yaml)
return unless group.licensed_feature_available?(:epics)
authorize!
......
......@@ -8,7 +8,7 @@ module Boards
override :can_create_board?
def can_create_board?
Feature.enabled?(:epic_boards, parent)
Feature.enabled?(:epic_boards, parent, default_enabled: :yaml)
end
override :parent_board_collection
......
......@@ -7,7 +7,7 @@ module Boards
override :execute
def execute(board)
unless Feature.enabled?(:epic_boards, board.group)
unless Feature.enabled?(:epic_boards, board.group, default_enabled: :yaml)
return ServiceResponse.error(message: 'Epic boards feature is not enabled.')
end
......
......@@ -11,7 +11,7 @@ module Boards
return ServiceResponse.error(message: 'Epics feature is not available.')
end
unless Feature.enabled?(:epic_boards, list.board.group)
unless Feature.enabled?(:epic_boards, list.board.group, default_enabled: :yaml)
return ServiceResponse.error(message: 'Epic boards feature is not enabled.')
end
......
......@@ -20,7 +20,7 @@
= link_to group_epics_path(group), title: 'List' do
%span= _('List')
- if Feature.enabled?(:epic_boards, group)
- if Feature.enabled?(:epic_boards, group, default_enabled: :yaml)
= nav_link(path: ['epic_boards#index', 'epic_boards#show'], html_options: { class: "home" }) do
= link_to group_epic_boards_path(group), title: 'Boards' do
%span= _('Boards')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment