summaryrefslogtreecommitdiff
path: root/app/controllers/clusters
diff options
context:
space:
mode:
authorRyan Cobb <rcobb@gitlab.com>2019-09-07 08:24:33 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-09-07 08:24:33 +0000
commit935ecf5c91683d7eb742099c4b26bb00c1fe95d0 (patch)
tree1a0f754b071484cd96dfebcc8b9472272eb539ca /app/controllers/clusters
parent093858adc76f893c35b0bcf25127c3f229a7bcb6 (diff)
downloadgitlab-ce-935ecf5c91683d7eb742099c4b26bb00c1fe95d0.tar.gz
Add method to authorize reading from prometheus proxy
Diffstat (limited to 'app/controllers/clusters')
-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