Skip to content
Snippets Groups Projects

Add `admin_runners` custom role permission

Merged mo khan requested to merge mokhax/442851/admin_runners into master
Compare and Show latest version
11 files
+ 90
21
Compare changes
  • Side-by-side
  • Inline
Files
11
@@ -9,7 +9,7 @@ class CiCdController < Projects::ApplicationController
layout 'project_settings'
before_action :authorize_admin_pipeline!, except: :show
before_action :authorize_admin_cicd_variables!, only: :show
before_action :authorize_admin_cicd_settings!, only: :show
before_action :check_builds_available!
before_action :define_variables
@@ -75,6 +75,18 @@ def runner_setup_scripts
private
def authorize_admin_cicd_settings!
return if can_any?(:admin_cicd_variables, :admin_runner, :admin_pipeline)
access_denied!
end
def can_any?(*permissions)
permissions.find do |permission|
can?(current_user, permission, project)
end
end
def highlight_badge(name, content, language = nil)
Gitlab::Highlight.highlight(name, content, language: language)
end
Loading