sequelize-typescript icon indicating copy to clipboard operation
sequelize-typescript copied to clipboard

Passing custom data to hooks

Open VamsiDharmaji opened this issue 4 years ago • 0 comments

Issue

We have implemented authorization and it depends on the requested user context to check for permissions and as well as createdBy/UpdatedBy columns

Sequelize library supports passing custom data to hooks as part of create/update..etc options

Reference issue discussed in types-sequelize

Taking an example of UpdateOptions , I don't see an option to pass any custom date to the hooks, we need pass on the user context from API request to the hooks that would call out internal services that uses the context to check for permissions.

Any help or pointers to resolve this issue is appreciated, I can try creating a PR if we agree to proceed this feature addition, if there is no workaround.

Versions

  • sequelize: 5.22.3
  • sequelize-typescript: 1.1.0
  • typescript: 4.1.3

Issue type

  • [ ] bug report
  • [X] feature request

VamsiDharmaji avatar Nov 08 '21 01:11 VamsiDharmaji