summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Cobb <rcobb@gitlab.com>2019-08-27 14:47:42 -0700
committerRyan Cobb <rcobb@gitlab.com>2019-08-27 14:47:42 -0700
commitbd7d863ebac815cd83a13f6b7abc22c242babb13 (patch)
treebadc088befc514e516d55705d52714df1152f610
parent8308469fdd031a1f7baa6e95966dfc467eb5df51 (diff)
downloadgitlab-ce-63044-ce-add-prom-proxies.tar.gz
Add method to authorize reading from prometheus proxy63044-ce-add-prom-proxies
-rw-r--r--app/controllers/clusters/base_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/clusters/base_controller.rb b/app/controllers/clusters/base_controller.rb
index ef42f7c4074..188805c6106 100644
--- a/app/controllers/clusters/base_controller.rb
+++ b/app/controllers/clusters/base_controller.rb
@@ -31,6 +31,10 @@ class Clusters::BaseController < ApplicationController
access_denied! unless can?(current_user, :create_cluster, clusterable)
end
+ def authorize_read_prometheus!
+ access_denied! unless can?(current_user, :read_prometheus, clusterable)
+ end
+
def clusterable
raise NotImplementedError
end