Enable linear version User#membership_groups

In this commit we're removing the ff
`linear_user_membership_groups` and enabling the
linear version of `User#membership_groups`.

Changelog: changed
parent 6b591ca2
......@@ -991,11 +991,7 @@ class User < ApplicationRecord
# Returns the groups a user is a member of, either directly or through a parent group
def membership_groups
if Feature.enabled?(:linear_user_membership_groups, self, default_enabled: :yaml)
groups.self_and_descendants
else
Gitlab::ObjectHierarchy.new(groups).base_and_descendants
end
groups.self_and_descendants
end
# Returns a relation of groups the user has access to, including their parent
......
---
name: linear_user_membership_groups
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68842
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339432
milestone: '14.3'
type: development
group: group::access
default_enabled: false
......@@ -3479,19 +3479,7 @@ RSpec.describe User do
subject { user.membership_groups }
shared_examples 'returns groups where the user is a member' do
specify { is_expected.to contain_exactly(parent_group, child_group) }
end
it_behaves_like 'returns groups where the user is a member'
context 'when feature flag :linear_user_membership_groups is disabled' do
before do
stub_feature_flags(linear_user_membership_groups: false)
end
it_behaves_like 'returns groups where the user is a member'
end
specify { is_expected.to contain_exactly(parent_group, child_group) }
end
describe '#authorizations_for_projects' 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