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
003a645a
Commit
003a645a
authored
Sep 15, 2020
by
manojmj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix bug in group security dashboard"
This reverts commit 627dfde1272ef142474e08e1a395d968d1ad8b1e.
parent
52ea9097
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
16 deletions
+8
-16
ee/app/helpers/groups/security_features_helper.rb
ee/app/helpers/groups/security_features_helper.rb
+1
-1
ee/spec/helpers/groups/security_features_helper_spec.rb
ee/spec/helpers/groups/security_features_helper_spec.rb
+3
-4
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
+4
-11
No files found.
ee/app/helpers/groups/security_features_helper.rb
View file @
003a645a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Groups::SecurityFeaturesHelper
module
Groups::SecurityFeaturesHelper
def
group_level_security_dashboard_available?
(
group
)
def
group_level_security_dashboard_available?
(
group
)
can?
(
current_user
,
:read_group_security_dashboard
,
group
)
group
.
feature_available?
(
:security_dashboard
)
end
end
def
group_level_compliance_dashboard_available?
(
group
)
def
group_level_compliance_dashboard_available?
(
group
)
...
...
ee/spec/helpers/groups/security_features_helper_spec.rb
View file @
003a645a
...
@@ -9,19 +9,18 @@ RSpec.describe Groups::SecurityFeaturesHelper do
...
@@ -9,19 +9,18 @@ RSpec.describe Groups::SecurityFeaturesHelper do
let_it_be
(
:user
,
refind:
true
)
{
create
(
:user
)
}
let_it_be
(
:user
,
refind:
true
)
{
create
(
:user
)
}
before
do
before
do
allow
(
helper
).
to
receive
(
:can?
)
{
|*
args
|
Ability
.
allowed?
(
*
args
)
}
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
end
describe
'#group_level_security_dashboard_available?'
do
describe
'#group_level_security_dashboard_available?'
do
where
(
:read_group_security_dashboard_permission
,
:result
)
do
where
(
:security_dashboard_feature_enabled
,
:result
)
do
false
|
false
true
|
true
true
|
true
false
|
false
end
end
with_them
do
with_them
do
before
do
before
do
allow
(
helper
).
to
receive
(
:can?
).
with
(
user
,
:read_group_security_dashboard
,
group
).
and_return
(
read_group_security_dashboard_permission
)
stub_licensed_features
(
security_dashboard:
security_dashboard_feature_enabled
)
end
end
it
'returns the expected result'
do
it
'returns the expected result'
do
...
...
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
View file @
003a645a
...
@@ -109,18 +109,11 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
...
@@ -109,18 +109,11 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
stub_licensed_features
(
security_dashboard:
true
)
stub_licensed_features
(
security_dashboard:
true
)
end
end
context
'when the user has access to Compliance dashboard'
do
it
'is visible'
do
before
do
render
group
.
add_developer
(
user
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
end
it
'is visible'
do
render
expect
(
rendered
).
to
have_link
'Security & Compliance'
expect
(
rendered
).
to
have_link
'Security & Compliance'
expect
(
rendered
).
to
have_link
'Security'
expect
(
rendered
).
to
have_link
'Security'
end
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