summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-23 09:14:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-23 09:14:52 +0000
commit347bf09d6ecf4871da234c06ca8ee541e27b5105 (patch)
tree2ad6943e0c681c22acc8850d1debc6a983b0e006 /app/helpers/projects_helper.rb
parent0a51be0866d33273070f535257626a9eb2e10700 (diff)
downloadgitlab-ce-13.10.0-rc20210223090520.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc20210223090520
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index f5cd89d96b4..b5c4e0b5550 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -379,10 +379,15 @@ module ProjectsHelper
private
def can_read_security_configuration?(project, current_user)
- ::Feature.enabled?(:secure_security_and_compliance_configuration_page_on_ce, @subject, default_enabled: :yaml) &&
+ show_security_and_compliance_config? &&
+ can?(current_user, :access_security_and_compliance, project) &&
can?(current_user, :read_security_configuration, project)
end
+ def show_security_and_compliance_config?
+ ::Feature.enabled?(:secure_security_and_compliance_configuration_page_on_ce, @subject, default_enabled: :yaml)
+ end
+
def get_project_security_nav_tabs(project, current_user)
if can_read_security_configuration?(project, current_user)
[:security_and_compliance, :security_configuration]
@@ -646,7 +651,8 @@ module ProjectsHelper
metricsDashboardAccessLevel: feature.metrics_dashboard_access_level,
operationsAccessLevel: feature.operations_access_level,
showDefaultAwardEmojis: project.show_default_award_emojis?,
- allowEditingCommitMessages: project.allow_editing_commit_messages?
+ allowEditingCommitMessages: project.allow_editing_commit_messages?,
+ securityAndComplianceAccessLevel: project.security_and_compliance_access_level
}
end
@@ -668,10 +674,13 @@ module ProjectsHelper
pagesAvailable: Gitlab.config.pages.enabled,
pagesAccessControlEnabled: Gitlab.config.pages.access_control,
pagesAccessControlForced: ::Gitlab::Pages.access_control_is_forced?,
- pagesHelpPath: help_page_path('user/project/pages/introduction', anchor: 'gitlab-pages-access-control')
+ pagesHelpPath: help_page_path('user/project/pages/introduction', anchor: 'gitlab-pages-access-control'),
+ securityAndComplianceAvailable: show_security_and_compliance_toggle?
}
end
+ alias_method :show_security_and_compliance_toggle?, :show_security_and_compliance_config?
+
def project_permissions_panel_data_json(project)
project_permissions_panel_data(project).to_json.html_safe
end