Commit 0afc1625 authored by harsimarsandhu's avatar harsimarsandhu

Ensures audit events are visible to auditor

Changelog: fixed
EE: true
parent 136f200c
...@@ -43,6 +43,8 @@ class Projects::AuditEventsController < Projects::ApplicationController ...@@ -43,6 +43,8 @@ class Projects::AuditEventsController < Projects::ApplicationController
end end
def filter_by_author(params) def filter_by_author(params)
can?(current_user, :admin_project, project) ? params : params.merge(author_id: current_user.id) return params if can?(current_user, :admin_project, project) || current_user.auditor?
params.merge(author_id: current_user.id)
end end
end end
...@@ -276,6 +276,7 @@ module EE ...@@ -276,6 +276,7 @@ module EE
enable :read_environment enable :read_environment
enable :read_deployment enable :read_deployment
enable :read_pages enable :read_pages
enable :read_project_audit_events
end end
rule { ~security_and_compliance_disabled & auditor }.policy do rule { ~security_and_compliance_disabled & auditor }.policy do
......
...@@ -47,6 +47,7 @@ RSpec.describe ProjectPolicy do ...@@ -47,6 +47,7 @@ RSpec.describe ProjectPolicy do
read_software_license_policy read_software_license_policy
read_threat_monitoring read_merge_train read_threat_monitoring read_merge_train
read_release read_release
read_project_audit_events
] ]
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment