Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an audit plugin. #264

Open
allanchau opened this issue Jun 24, 2019 · 0 comments
Open

Add an audit plugin. #264

allanchau opened this issue Jun 24, 2019 · 0 comments
Assignees

Comments

@allanchau
Copy link
Contributor

allanchau commented Jun 24, 2019

Is your feature request related to a problem? Please describe.
We have been inconsistently implementing a modifiedBy (and others) reference field across numerous projects. This is causing an unintended side effect of slowing down the list view due to multiple queries to go and grab the reference value.

Describe the solution you'd like
Create a mongoose plugin that:

  • Automatically adds modifiedBy, createdBy, dateModified, dateCreated fields.
  • The ...By fields should be objectids referencing the linz user model.
  • The date... fields should be date fields.
  • These fields should be hidden and disabled from all forms by default. This includes things like exports and filters.

By doing this we can populate the field so that only 1 query is needed.

Describe alternatives you've considered
We can implement this per project, but I think it is something that would be useful as an audit across all projects.

Additional context
Add mongoose.set('debug', true); to a project which uses the modifiedBy and view the mongo logs. There should be 1 additional query per line.

@allanchau allanchau self-assigned this Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant