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
d9059c48
Commit
d9059c48
authored
Oct 21, 2019
by
Jason Goodman
Committed by
Mayra Cabrera
Oct 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reject anonymous users for read_operations_dashboard
Adjust global policy
parent
d1472cf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
ee/app/policies/ee/global_policy.rb
ee/app/policies/ee/global_policy.rb
+1
-1
ee/spec/policies/global_policy_spec.rb
ee/spec/policies/global_policy_spec.rb
+12
-4
No files found.
ee/app/policies/ee/global_policy.rb
View file @
d9059c48
...
@@ -13,7 +13,7 @@ module EE
...
@@ -13,7 +13,7 @@ module EE
License
.
feature_available?
(
:security_dashboard
)
License
.
feature_available?
(
:security_dashboard
)
end
end
rule
{
operations_dashboard_available
}.
enable
:read_operations_dashboard
rule
{
~
anonymous
&
operations_dashboard_available
}.
enable
:read_operations_dashboard
rule
{
~
anonymous
&
security_dashboard_available
}.
enable
:read_security_dashboard
rule
{
~
anonymous
&
security_dashboard_available
}.
enable
:read_security_dashboard
rule
{
admin
}.
policy
do
rule
{
admin
}.
policy
do
...
...
ee/spec/policies/global_policy_spec.rb
View file @
d9059c48
...
@@ -11,11 +11,19 @@ describe GlobalPolicy do
...
@@ -11,11 +11,19 @@ describe GlobalPolicy do
subject
{
described_class
.
new
(
current_user
,
[
user
])
}
subject
{
described_class
.
new
(
current_user
,
[
user
])
}
describe
'reading operations dashboard'
do
describe
'reading operations dashboard'
do
before
do
context
'when licensed'
do
stub_licensed_features
(
operations_dashboard:
true
)
before
do
end
stub_licensed_features
(
operations_dashboard:
true
)
end
it
{
is_expected
.
to
be_allowed
(
:read_operations_dashboard
)
}
it
{
is_expected
.
to
be_allowed
(
:read_operations_dashboard
)
}
context
'and the user is not logged in'
do
let
(
:current_user
)
{
nil
}
it
{
is_expected
.
not_to
be_allowed
(
:read_operations_dashboard
)
}
end
end
context
'when unlicensed'
do
context
'when unlicensed'
do
before
do
before
do
...
...
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