Use linear version User#groups_with_developer_maintainer_project_access

parent a9a8dd14
...@@ -2168,12 +2168,7 @@ class User < ApplicationRecord ...@@ -2168,12 +2168,7 @@ class User < ApplicationRecord
project_creation_levels << nil project_creation_levels << nil
end end
if Feature.enabled?(:linear_user_groups_with_developer_maintainer_project_access, self, default_enabled: :yaml) developer_groups.self_and_descendants.where(project_creation_level: project_creation_levels)
developer_groups.self_and_descendants.where(project_creation_level: project_creation_levels)
else
developer_groups_hierarchy = ::Gitlab::ObjectHierarchy.new(developer_groups).base_and_descendants
::Group.where(id: developer_groups_hierarchy.select(:id), project_creation_level: project_creation_levels)
end
end end
def no_recent_activity? def no_recent_activity?
......
---
name: linear_user_groups_with_developer_maintainer_project_access
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68851
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339436
milestone: '14.3'
type: development
group: group::access
default_enabled: false
...@@ -6246,19 +6246,7 @@ RSpec.describe User do ...@@ -6246,19 +6246,7 @@ RSpec.describe User do
subject { user.send(:groups_with_developer_maintainer_project_access) } subject { user.send(:groups_with_developer_maintainer_project_access) }
shared_examples 'groups_with_developer_maintainer_project_access examples' do specify { is_expected.to contain_exactly(developer_group2) }
specify { is_expected.to contain_exactly(developer_group2) }
end
it_behaves_like 'groups_with_developer_maintainer_project_access examples'
context 'when feature flag :linear_user_groups_with_developer_maintainer_project_access is disabled' do
before do
stub_feature_flags(linear_user_groups_with_developer_maintainer_project_access: false)
end
it_behaves_like 'groups_with_developer_maintainer_project_access examples'
end
end end
describe '.get_ids_by_username' do describe '.get_ids_by_username' 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