enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Content API - Audit Log Usage #7424

Closed GlennRicaud closed 5 years ago

GlennRicaud commented 5 years ago

To be PRed to master

At ContentService level, use the AuditLogService to log for each call of the following methods (the methods updating the state):

    create
    update
    rename
    delete
    deleteWithoutFetch
    undoPendingDelete
    publish
    unpublishContent
    duplicate
    move
    setChildOrder
    reorderChildren
    applyPermissions
    setActiveContentVersion
    reprocess
GlennRicaud commented 5 years ago
sigdestad commented 5 years ago

Hi. I have had a look at the actions to log, and have some questions/input:

GlennRicaud commented 5 years ago

reprocess - It does. delete - Both undoPendingDelete - Why not? publish/unpublish - I thought the idea was to log the usage of the API and not the results of the actions setChildOrder/reorderChildren: One is changing the childOrder on a nodem the other one is reordering the children of a node

GlennRicaud commented 5 years ago

@sigdestad: But we need to agree on the messages format though Should it include the user? Should it include the objects of the action? Should it be in past tense? ...

Example:

Message If ids.length > 1
Create a new site  
Create a new content  
Create a new media  
Update the content [%s]  
Update the media [%s]  
Delete the content [%s]  
Undo the deletion of the content [%s] Undo the deletion of [%d] contents
Publish the content [%s] Publish [%d] contents
Unpublish the content [%s] Unpublish [%d] contents
Duplicate the content [%s]  
Move the content [%s] under parent with path [%s]  
Rename the content [%s]  
Set active the content version [%s][%s]  
Set the child order for the content [%s]  
Reorder the children of the content [%s]  
Apply permissions for the content [%s]  
Reprocess the content [%s]