Skip to content
代码片段 群组 项目
未验证 提交 4d57d18d 编辑于 作者: Robert Speicher's avatar Robert Speicher
浏览文件

Revert "Merge branch 'security-12-4-filter-member-only-packages' into '12-4-stable-ee'"

This reverts commit 756ba726.
上级 756ba726
No related branches found
No related tags found
无相关合并请求
...@@ -30,8 +30,6 @@ def group_projects_visible_to_current_user ...@@ -30,8 +30,6 @@ def group_projects_visible_to_current_user
::Project ::Project
.in_namespace(groups) .in_namespace(groups)
.public_or_visible_to_user(current_user, Gitlab::Access::REPORTER) .public_or_visible_to_user(current_user, Gitlab::Access::REPORTER)
.with_project_feature
.select { |project| Ability.allowed?(current_user, :read_package, project) }
end end
def package_type def package_type
......
---
title: Filter out packages the user does'nt have permission to see at group level
merge_request:
author:
type: security
...@@ -72,40 +72,5 @@ def self.package_types ...@@ -72,40 +72,5 @@ def self.package_types
it { is_expected.to match_array([package1])} it { is_expected.to match_array([package1])}
end end
context 'when project is public' do
set(:other_user) { create(:user) }
let(:finder) { described_class.new(other_user, group) }
before do
project.update!(visibility_level: ProjectFeature::ENABLED)
end
context 'when packages are public' do
before do
project.project_feature.update!(
builds_access_level: ProjectFeature::PRIVATE,
merge_requests_access_level: ProjectFeature::PRIVATE,
repository_access_level: ProjectFeature::ENABLED)
end
it 'returns group packages' do
expect(finder.execute).to match_array([package1, package2])
end
end
context 'packages are members only' do
before do
project.project_feature.update!(
builds_access_level: ProjectFeature::PRIVATE,
merge_requests_access_level: ProjectFeature::PRIVATE,
repository_access_level: ProjectFeature::PRIVATE)
end
it 'filters out the project if the user doesn\'t have permission' do
expect(finder.execute).to be_empty
end
end
end
end end
end end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册