Skip to content

include collection names on audit-log table#50

Open
JustRelaxable wants to merge 1 commit intoshaadcode:mainfrom
JustRelaxable:main
Open

include collection names on audit-log table#50
JustRelaxable wants to merge 1 commit intoshaadcode:mainfrom
JustRelaxable:main

Conversation

@JustRelaxable
Copy link
Copy Markdown

Hi, the current implementation of the plugin assumes the changes only comes from the users collection. However Payload CMS supports auth enabled collections, and it is important to log their changes too.
This PR aims to change auditor table column name: 'user', type: 'relationship', relationTo: 'users' to name: 'user', type: 'json', required: false to be able to save both CollectionSlug as well as the ID. I also tried to create a custom component to render default RelationshipInput on admin panel UI but with plugins it may not be possible to use custom component.

resim

The aim is to save both collection name and id of the user, account or whatever auth:true collection and render RelationshipInput UI on admin panel.

Users collection:
resim

App Account collection:
resim

Hi, the current implementation of the plugin assumes the changes only comes from the users collection. However Payload CMS supports auth enabled collections, and it is important to log their changes too.
@shaadcode
Copy link
Copy Markdown
Owner

Thank you sincerely for your effort to improve payload-auditor.

Considering that currently payload-auditor performs somewhat weakly in default collection management, your idea is very good and practical and can solve a problem.

But we need to examine more aspects because this PR will change the depth of the plugin architecture and may increase the plugin size.

I will look into this as soon as possible.

Thank you for your cooperation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants