Commit cd5b0789 authored by Kamil Trzciński's avatar Kamil Trzciński

Remove implicit FF check on `Featurable`

This ensures that we do not perform implicit
check for features that should not be treated
as feature-flagged.

The feature flag in such cases should be
explicitly defined.
parent 93a295d6
......@@ -88,9 +88,6 @@ module Featurable
end
def feature_available?(feature, user)
# This feature might not be behind a feature flag at all, so default to true
return false unless ::Feature.enabled?(feature, user, default_enabled: true)
get_permission(user, feature)
end
......
---
title: Remove implicit FF check on `Featurable`
merge_request:
author:
type: removed
......@@ -134,22 +134,6 @@ RSpec.describe Featurable do
expect(project.feature_available?(:issues, user)).to eq(true)
end
end
context 'when feature is disabled by a feature flag' do
it 'returns false' do
stub_feature_flags(issues: false)
expect(project.feature_available?(:issues, user)).to eq(false)
end
end
context 'when feature is enabled by a feature flag' do
it 'returns true' do
stub_feature_flags(issues: true)
expect(project.feature_available?(:issues, user)).to eq(true)
end
end
end
describe '#*_enabled?' do
......
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