Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
935ecf5c
Commit
935ecf5c
authored
Sep 07, 2019
by
Ryan Cobb
Committed by
Kamil Trzciński
Sep 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to authorize reading from prometheus proxy
parent
093858ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
app/controllers/clusters/base_controller.rb
app/controllers/clusters/base_controller.rb
+4
-0
app/policies/clusters/instance_policy.rb
app/policies/clusters/instance_policy.rb
+1
-0
No files found.
app/controllers/clusters/base_controller.rb
View file @
935ecf5c
...
...
@@ -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
...
...
app/policies/clusters/instance_policy.rb
View file @
935ecf5c
...
...
@@ -8,6 +8,7 @@ module Clusters
enable
:create_cluster
enable
:update_cluster
enable
:admin_cluster
enable
:read_prometheus
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment