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
662a01dc
Commit
662a01dc
authored
Feb 22, 2022
by
harsimarsandhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensures audit events are visible to auditor
Changelog: fixed EE: true
parent
c5a348be
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
137 additions
and
107 deletions
+137
-107
ee/app/controllers/groups/audit_events_controller.rb
ee/app/controllers/groups/audit_events_controller.rb
+3
-1
ee/app/policies/ee/group_policy.rb
ee/app/policies/ee/group_policy.rb
+1
-0
ee/spec/controllers/groups/audit_events_controller_spec.rb
ee/spec/controllers/groups/audit_events_controller_spec.rb
+132
-106
ee/spec/policies/group_policy_spec.rb
ee/spec/policies/group_policy_spec.rb
+1
-0
No files found.
ee/app/controllers/groups/audit_events_controller.rb
View file @
662a01dc
...
...
@@ -44,6 +44,8 @@ class Groups::AuditEventsController < Groups::ApplicationController
end
def
filter_by_author
(
params
)
can?
(
current_user
,
:admin_group
,
group
)
?
params
:
params
.
merge
(
author_id:
current_user
.
id
)
return
params
if
can?
(
current_user
,
:admin_group
,
group
)
||
current_user
.
auditor?
params
.
merge
(
author_id:
current_user
.
id
)
end
end
ee/app/policies/ee/group_policy.rb
View file @
662a01dc
...
...
@@ -270,6 +270,7 @@ module EE
rule
{
auditor
}.
policy
do
enable
:read_group
enable
:read_group_security_dashboard
enable
:read_group_audit_events
end
rule
{
group_saml_config_enabled
&
group_saml_available
&
(
admin
|
owner
)
}.
enable
:admin_group_saml
...
...
ee/spec/controllers/groups/audit_events_controller_spec.rb
View file @
662a01dc
This diff is collapsed.
Click to expand it.
ee/spec/policies/group_policy_spec.rb
View file @
662a01dc
...
...
@@ -610,6 +610,7 @@ RSpec.describe GroupPolicy do
it
{
is_expected
.
to
be_allowed
(
:read_group
)
}
it
{
is_expected
.
to
be_allowed
(
:read_milestone
)
}
it
{
is_expected
.
to
be_allowed
(
:read_group_audit_events
)
}
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