diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 18:08:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 18:08:31 +0000 |
commit | 92f95ccac81911d1fcc32e999a7f1ce04624a56c (patch) | |
tree | ad207e86b7858ae93a085fbdc04155f5cd469620 /app/models/project_feature.rb | |
parent | 85e494935a8726dc98bb19ffa584488420e5011e (diff) | |
download | gitlab-ce-92f95ccac81911d1fcc32e999a7f1ce04624a56c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_feature.rb')
-rw-r--r-- | app/models/project_feature.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb index 4973c7761c1..ec097844499 100644 --- a/app/models/project_feature.rb +++ b/app/models/project_feature.rb @@ -97,7 +97,13 @@ class ProjectFeature < ApplicationRecord default_value_for :wiki_access_level, value: ENABLED, allows_nil: false default_value_for :repository_access_level, value: ENABLED, allows_nil: false - default_value_for(:pages_access_level, allows_nil: false) { |feature| feature.project&.public? ? ENABLED : PRIVATE } + default_value_for(:pages_access_level, allows_nil: false) do |feature| + if ::Gitlab::Pages.access_control_is_forced? + PRIVATE + else + feature.project&.public? ? ENABLED : PRIVATE + end + end def feature_available?(feature, user) # This feature might not be behind a feature flag at all, so default to true @@ -137,6 +143,8 @@ class ProjectFeature < ApplicationRecord def public_pages? return true unless Gitlab.config.pages.access_control + return false if ::Gitlab::Pages.access_control_is_forced? + pages_access_level == PUBLIC || pages_access_level == ENABLED && project.public? end |