Skip to content
Snippets Groups Projects

Add `admin_runners` custom role permission

Merged mo khan requested to merge mokhax/442851/admin_runners into master
All threads resolved!
Compare and Show latest version
5 files
+ 48
2
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -6,7 +6,7 @@ class CiCdController < Groups::ApplicationController
layout 'group_settings'
skip_cross_project_access_check :show
before_action :authorize_admin_group!, except: :show
before_action :authorize_admin_cicd_variables!, only: :show
before_action :authorize_admin_cicd_settings!, only: :show
before_action :authorize_update_max_artifacts_size!, only: [:update]
before_action :define_variables, only: [:show]
before_action :push_licensed_features, only: [:show]
@@ -47,6 +47,18 @@ def update_auto_devops
private
def authorize_admin_cicd_settings!
return if can_any?(:admin_cicd_variables, :admin_runner, :admin_group)
access_denied!
end
def can_any?(*permissions)
permissions.any? do |permission|
can?(current_user, permission, group)
end
end
def define_variables
define_ci_variables
end
Loading