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
4b6c0b30
Commit
4b6c0b30
authored
Nov 02, 2021
by
Dan Jensen
Committed by
Jarka Košanová
Nov 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug with AuditEvent target_id
parent
62dd5e5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
ee/app/services/ee/audit_event_service.rb
ee/app/services/ee/audit_event_service.rb
+6
-1
ee/spec/services/audit_event_service_spec.rb
ee/spec/services/audit_event_service_spec.rb
+3
-0
No files found.
ee/app/services/ee/audit_event_service.rb
View file @
4b6c0b30
...
...
@@ -13,7 +13,8 @@ module EE
def
for_member
(
member
)
action
=
@details
[
:action
]
old_access_level
=
@details
[
:old_access_level
]
user_id
=
member
.
id
user_id
=
member
.
user_id
member_id
=
member
.
id
user_name
=
member
.
user
?
member
.
user
.
name
:
'Deleted User'
target_type
=
'User'
...
...
@@ -24,6 +25,7 @@ module EE
remove:
"user_access"
,
author_name:
@author
.
name
,
target_id:
user_id
,
member_id:
member_id
,
target_type:
target_type
,
target_details:
user_name
}
...
...
@@ -32,6 +34,7 @@ module EE
remove:
"user_access"
,
author_name:
member
.
created_by
?
member
.
created_by
.
name
:
'Deleted User'
,
target_id:
user_id
,
member_id:
member_id
,
target_type:
target_type
,
target_details:
user_name
,
system_event:
true
,
...
...
@@ -43,6 +46,7 @@ module EE
as:
::
Gitlab
::
Access
.
options_with_owner
.
key
(
member
.
access_level
.
to_i
),
author_name:
@author
.
name
,
target_id:
user_id
,
member_id:
member_id
,
target_type:
target_type
,
target_details:
user_name
}
...
...
@@ -55,6 +59,7 @@ module EE
expiry_to:
member
.
expires_at
,
author_name:
@author
.
name
,
target_id:
user_id
,
member_id:
member_id
,
target_type:
target_type
,
target_details:
user_name
}
...
...
ee/spec/services/audit_event_service_spec.rb
View file @
4b6c0b30
...
...
@@ -22,6 +22,9 @@ RSpec.describe AuditEventService, :request_store do
it
'generates event'
do
expect
(
event_details
[
:target_details
]).
to
eq
(
user
.
name
)
expect
(
event_details
[
:target_id
]).
to
eq
(
user
.
id
)
expect
(
event_details
[
:target_type
]).
to
eq
(
'User'
)
expect
(
event_details
[
:member_id
]).
to
eq
(
project_member
.
id
)
end
it
'handles deleted users'
do
...
...
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