Commit e949a330 authored by Markus Koller's avatar Markus Koller

Merge branch '339432-fj-enable-linear-user-membership-groups-ff' into 'master'

Enable linear version User#membership_groups

See merge request gitlab-org/gitlab!74529
parents fbd35cb2 1200642b
......@@ -993,11 +993,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
......@@ -3525,19 +3525,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