Commit d38f1c03 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'allow_public_view_of_pipeline_schedules' into 'master'

Allow public view of pipeline schedules

Closes #22104

See merge request gitlab-org/gitlab!20806
parents 64239c86 cfbf23e3
...@@ -224,6 +224,7 @@ class ProjectPolicy < BasePolicy ...@@ -224,6 +224,7 @@ class ProjectPolicy < BasePolicy
enable :read_build enable :read_build
enable :read_container_image enable :read_container_image
enable :read_pipeline enable :read_pipeline
enable :read_pipeline_schedule
enable :read_environment enable :read_environment
enable :read_deployment enable :read_deployment
enable :read_merge_request enable :read_merge_request
...@@ -281,7 +282,6 @@ class ProjectPolicy < BasePolicy ...@@ -281,7 +282,6 @@ class ProjectPolicy < BasePolicy
enable :update_commit_status enable :update_commit_status
enable :create_build enable :create_build
enable :update_build enable :update_build
enable :read_pipeline_schedule
enable :create_merge_request_from enable :create_merge_request_from
enable :create_wiki enable :create_wiki
enable :push_code enable :push_code
...@@ -422,6 +422,7 @@ class ProjectPolicy < BasePolicy ...@@ -422,6 +422,7 @@ class ProjectPolicy < BasePolicy
prevent :fork_project prevent :fork_project
prevent :read_commit_status prevent :read_commit_status
prevent :read_pipeline prevent :read_pipeline
prevent :read_pipeline_schedule
prevent(*create_read_update_admin_destroy(:release)) prevent(*create_read_update_admin_destroy(:release))
end end
...@@ -448,6 +449,7 @@ class ProjectPolicy < BasePolicy ...@@ -448,6 +449,7 @@ class ProjectPolicy < BasePolicy
enable :read_merge_request enable :read_merge_request
enable :read_note enable :read_note
enable :read_pipeline enable :read_pipeline
enable :read_pipeline_schedule
enable :read_commit_status enable :read_commit_status
enable :read_container_image enable :read_container_image
enable :download_code enable :download_code
...@@ -466,6 +468,7 @@ class ProjectPolicy < BasePolicy ...@@ -466,6 +468,7 @@ class ProjectPolicy < BasePolicy
rule { public_builds & can?(:guest_access) }.policy do rule { public_builds & can?(:guest_access) }.policy do
enable :read_pipeline enable :read_pipeline
enable :read_pipeline_schedule
end end
# These rules are included to allow maintainers of projects to push to certain # These rules are included to allow maintainers of projects to push to certain
......
---
title: Allow public access to pipeline schedules
merge_request: 20806
author: Lee Tickett
type: fixed
...@@ -464,9 +464,9 @@ describe "Internal Project Access" do ...@@ -464,9 +464,9 @@ describe "Internal Project Access" do
it { is_expected.to be_allowed_for(:owner).of(project) } it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) } it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) } it { is_expected.to be_allowed_for(:developer).of(project) }
it { is_expected.to be_denied_for(:reporter).of(project) } it { is_expected.to be_allowed_for(:reporter).of(project) }
it { is_expected.to be_denied_for(:guest).of(project) } it { is_expected.to be_allowed_for(:guest).of(project) }
it { is_expected.to be_denied_for(:user) } it { is_expected.to be_allowed_for(:user) }
it { is_expected.to be_denied_for(:external) } it { is_expected.to be_denied_for(:external) }
it { is_expected.to be_denied_for(:visitor) } it { is_expected.to be_denied_for(:visitor) }
end end
......
...@@ -499,7 +499,7 @@ describe "Private Project Access" do ...@@ -499,7 +499,7 @@ describe "Private Project Access" do
it { is_expected.to be_allowed_for(:owner).of(project) } it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) } it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) } it { is_expected.to be_allowed_for(:developer).of(project) }
it { is_expected.to be_denied_for(:reporter).of(project) } it { is_expected.to be_allowed_for(:reporter).of(project) }
it { is_expected.to be_denied_for(:guest).of(project) } it { is_expected.to be_denied_for(:guest).of(project) }
it { is_expected.to be_denied_for(:user) } it { is_expected.to be_denied_for(:user) }
it { is_expected.to be_denied_for(:external) } it { is_expected.to be_denied_for(:external) }
......
...@@ -278,11 +278,11 @@ describe "Public Project Access" do ...@@ -278,11 +278,11 @@ describe "Public Project Access" do
it { is_expected.to be_allowed_for(:owner).of(project) } it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) } it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) } it { is_expected.to be_allowed_for(:developer).of(project) }
it { is_expected.to be_denied_for(:reporter).of(project) } it { is_expected.to be_allowed_for(:reporter).of(project) }
it { is_expected.to be_denied_for(:guest).of(project) } it { is_expected.to be_allowed_for(:guest).of(project) }
it { is_expected.to be_denied_for(:user) } it { is_expected.to be_allowed_for(:user) }
it { is_expected.to be_denied_for(:external) } it { is_expected.to be_allowed_for(:external) }
it { is_expected.to be_denied_for(:visitor) } it { is_expected.to be_allowed_for(:visitor) }
end end
describe "GET /:project_path/-/environments" do describe "GET /:project_path/-/environments" 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