Commit 1f4de299 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '351603-auditor-project-level-events' into 'master'

Ensures audit events are visible to auditor at Project level

See merge request gitlab-org/gitlab!81497
parents 89339612 0afc1625
......@@ -43,6 +43,8 @@ class Projects::AuditEventsController < Projects::ApplicationController
end
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
......@@ -276,6 +276,7 @@ module EE
enable :read_environment
enable :read_deployment
enable :read_pages
enable :read_project_audit_events
end
rule { ~security_and_compliance_disabled & auditor }.policy do
......
......@@ -47,6 +47,7 @@ RSpec.describe ProjectPolicy do
read_software_license_policy
read_threat_monitoring read_merge_train
read_release
read_project_audit_events
]
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