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
99238a7e
Commit
99238a7e
authored
Jul 05, 2017
by
Toon Claes
Committed by
Toon Claes
Jul 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show/enable Audit Events when feature is available
parent
4b6ac32f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
67 additions
and
8 deletions
+67
-8
app/controllers/groups/audit_events_controller.rb
app/controllers/groups/audit_events_controller.rb
+1
-0
app/controllers/projects/audit_events_controller.rb
app/controllers/projects/audit_events_controller.rb
+1
-0
app/views/groups/ee/_settings_nav.html.haml
app/views/groups/ee/_settings_nav.html.haml
+5
-4
app/views/projects/settings/_head.html.haml
app/views/projects/settings/_head.html.haml
+1
-4
app/views/projects/settings/ee/_nav.html.haml
app/views/projects/settings/ee/_nav.html.haml
+5
-0
changelogs/unreleased-ee/tc-namespace-license-checks--audit-events.yml
...released-ee/tc-namespace-license-checks--audit-events.yml
+4
-0
spec/features/groups/audit_events_spec.rb
spec/features/groups/audit_events_spec.rb
+24
-0
spec/features/projects/audit_events_spec.rb
spec/features/projects/audit_events_spec.rb
+26
-0
No files found.
app/controllers/groups/audit_events_controller.rb
View file @
99238a7e
class
Groups::AuditEventsController
<
Groups
::
ApplicationController
before_action
:authorize_admin_group!
before_action
:check_audit_events_available!
layout
'group_settings'
...
...
app/controllers/projects/audit_events_controller.rb
View file @
99238a7e
class
Projects::AuditEventsController
<
Projects
::
ApplicationController
before_action
:authorize_admin_project!
before_action
:check_audit_events_available!
layout
'project_settings'
...
...
app/views/groups/ee/_settings_nav.html.haml
View file @
99238a7e
...
...
@@ -10,10 +10,11 @@
%span
Webhooks
=
nav_link
(
path:
'audit_events#index'
)
do
=
link_to
group_audit_events_path
(
@group
),
title:
'Audit Events'
do
%span
Audit Events
-
if
@group
.
feature_available?
(
:audit_events
)
=
nav_link
(
path:
'audit_events#index'
)
do
=
link_to
group_audit_events_path
(
@group
),
title:
'Audit Events'
do
%span
Audit Events
-
if
@group
.
shared_runners_enabled?
&&
@group
.
shared_runners_minutes_limit_enabled?
=
nav_link
(
path:
'pipeline_quota#index'
)
do
...
...
app/views/projects/settings/_head.html.haml
View file @
99238a7e
...
...
@@ -29,7 +29,4 @@
%span
Pages
=
nav_link
(
controller: :audit_events
)
do
=
link_to
project_audit_events_path
(
@project
),
title:
"Audit Events"
do
%span
Audit Events
=
render
'projects/settings/ee/nav'
app/views/projects/settings/ee/_nav.html.haml
0 → 100644
View file @
99238a7e
-
if
@project
.
feature_available?
(
:audit_events
)
=
nav_link
(
controller: :audit_events
)
do
=
link_to
project_audit_events_path
(
@project
),
title:
"Audit Events"
do
%span
Audit Events
changelogs/unreleased-ee/tc-namespace-license-checks--audit-events.yml
0 → 100644
View file @
99238a7e
---
title
:
Namespace license checks Audit Events & Admin Audit Log
merge_request
:
2326
author
:
spec/features/groups/audit_events_spec.rb
View file @
99238a7e
...
...
@@ -11,6 +11,30 @@ feature 'Groups > Audit Events', js: true, feature: true do
sign_in
(
user
)
end
context
'unlicensed'
do
before
do
stub_licensed_features
(
audit_events:
false
)
end
it
'returns 404'
do
visit
group_audit_events_path
(
group
)
expect
(
page
.
status_code
).
to
eq
(
404
)
end
it
'does not have Audit Events button in head nav bar'
do
visit
edit_group_path
(
group
)
expect
(
page
).
not_to
have_link
(
'Audit Events'
)
end
end
it
'has Audit Events button in head nav bar'
do
visit
edit_group_path
(
group
)
expect
(
page
).
to
have_link
(
'Audit Events'
)
end
describe
'changing a user access level'
do
it
"appears in the group's audit events"
do
visit
group_group_members_path
(
group
)
...
...
spec/features/projects/audit_events_spec.rb
View file @
99238a7e
...
...
@@ -10,8 +10,34 @@ feature 'Projects > Audit Events', js: true, feature: true do
sign_in
(
user
)
end
context
'unlicensed'
do
before
do
stub_licensed_features
(
audit_events:
false
)
end
it
'returns 404'
do
visit
project_audit_events_path
(
project
)
expect
(
page
.
status_code
).
to
eq
(
404
)
end
it
'does not have Audit Events button in head nav bar'
do
visit
edit_project_path
(
project
)
expect
(
page
).
not_to
have_link
(
'Audit Events'
)
end
end
it
'has Audit Events button in head nav bar'
do
visit
edit_project_path
(
project
)
expect
(
page
).
to
have_link
(
'Audit Events'
)
end
describe
'adding an SSH key'
do
it
"appears in the project's audit events"
do
stub_licensed_features
(
audit_events:
true
)
visit
new_project_deploy_key_path
(
project
)
fill_in
'deploy_key_title'
,
with:
'laptop'
...
...
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