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 @@
module
Groups::SecurityFeaturesHelper
def
group_level_security_dashboard_available?
(
group
)
can?
(
current_user
,
:read_group_security_dashboard
,
group
)
group
.
feature_available?
(
:security_dashboard
)
end
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
let_it_be
(
:user
,
refind:
true
)
{
create
(
:user
)
}
before
do
allow
(
helper
).
to
receive
(
:can?
)
{
|*
args
|
Ability
.
allowed?
(
*
args
)
}
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
describe
'#group_level_security_dashboard_available?'
do
where
(
:read_group_security_dashboard_permission
,
:result
)
do
false
|
false
where
(
:security_dashboard_feature_enabled
,
:result
)
do
true
|
true
false
|
false
end
with_them
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
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
stub_licensed_features
(
security_dashboard:
true
)
end
context
'when the user has access to Compliance dashboard'
do
before
do
group
.
add_developer
(
user
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
end
it
'is visible'
do
render
it
'is visible'
do
render
expect
(
rendered
).
to
have_link
'Security & Compliance'
expect
(
rendered
).
to
have_link
'Security'
end
expect
(
rendered
).
to
have_link
'Security & Compliance'
expect
(
rendered
).
to
have_link
'Security'
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