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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
540a3dd7
Commit
540a3dd7
authored
Jan 20, 2020
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move permissions check to cluster subclass
parent
0282ab15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
app/services/metrics/dashboard/base_service.rb
app/services/metrics/dashboard/base_service.rb
+3
-7
ee/app/services/metrics/dashboard/cluster_dashboard_service.rb
...p/services/metrics/dashboard/cluster_dashboard_service.rb
+5
-0
No files found.
app/services/metrics/dashboard/base_service.rb
View file @
540a3dd7
...
...
@@ -38,13 +38,9 @@ module Metrics
# Determines whether users should be able to view
# dashboards at all.
def
allowed?
if
params
[
:environment
]
Ability
.
allowed?
(
current_user
,
:read_environment
,
project
)
elsif
params
[
:cluster
]
true
# Authorization handled at controller level
else
false
end
return
false
unless
params
[
:environment
]
Ability
.
allowed?
(
current_user
,
:read_environment
,
project
)
end
# Returns a new dashboard Hash, supplemented with DB info
...
...
ee/app/services/metrics/dashboard/cluster_dashboard_service.rb
View file @
540a3dd7
...
...
@@ -13,6 +13,11 @@ module Metrics
STAGES
::
ClusterEndpointInserter
,
STAGES
::
Sorter
].
freeze
# Permissions are handled at the controller level
def
allowed?
true
end
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