@@ -48,7 +48,7 @@ def create
4848 created_by_user : current_user
4949 )
5050 Libraries ::LogEvent . call (
51- library : library , actor : current_user , actor_type : api_author_type ,
51+ library : library , actor : current_user , ** library_event_identity ,
5252 event_type : "folder_created" , folder : folder , after : folder . path
5353 )
5454 render json : folder_json ( folder ) , status : :created
@@ -93,7 +93,7 @@ def destroy
9393 path = @folder . path
9494 if @folder . destroy
9595 Libraries ::LogEvent . call (
96- library : @folder . library , actor : current_user , actor_type : api_author_type ,
96+ library : @folder . library , actor : current_user , ** library_event_identity ,
9797 event_type : "folder_deleted" , before : path ,
9898 metadata : { folder_name : @folder . name }
9999 )
@@ -117,26 +117,34 @@ def log_folder_update(old_path, old_description)
117117 new_path = @folder . path
118118 if @folder . saved_change_to_name?
119119 Libraries ::LogEvent . call (
120- library : @folder . library , actor : current_user , actor_type : api_author_type ,
120+ library : @folder . library , actor : current_user , ** library_event_identity ,
121121 event_type : "folder_renamed" , folder : @folder , before : old_path , after : new_path
122122 )
123123 end
124124 if @folder . saved_change_to_parent_id?
125125 Libraries ::LogEvent . call (
126- library : @folder . library , actor : current_user , actor_type : api_author_type ,
126+ library : @folder . library , actor : current_user , ** library_event_identity ,
127127 event_type : "folder_moved" , folder : @folder , before : old_path , after : new_path
128128 )
129129 end
130130 if @folder . saved_change_to_description?
131131 Libraries ::LogEvent . call (
132- library : @folder . library , actor : current_user , actor_type : api_author_type ,
132+ library : @folder . library , actor : current_user , ** library_event_identity ,
133133 event_type : "folder_described" , folder : @folder ,
134134 before : old_description , after : @folder . description ,
135135 metadata : { path : new_path }
136136 )
137137 end
138138 end
139139
140+ def library_event_identity
141+ {
142+ actor_type : api_author_type ,
143+ agent_name : api_agent_name ,
144+ api_token_id : api_token_id
145+ }
146+ end
147+
140148 # `paths` and `counts` let index serialize the whole tree without
141149 # per-folder queries. `plans_count` is the folder's own visible
142150 # placements (not including subfolders).
0 commit comments