loopback4-soft-delete | A loopback4 extension for soft delete feature | Web Framework library
kandi X-RAY | loopback4-soft-delete Summary
kandi X-RAY | loopback4-soft-delete Summary
A loopback4 extension for soft delete feature
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of loopback4-soft-delete
loopback4-soft-delete Key Features
loopback4-soft-delete Examples and Code Snippets
Community Discussions
Trending Discussions on loopback4-soft-delete
QUESTION
I'm working on loopback4-soft-delete component. I need to add deletedBy
field to SoftDeleteEntity model. deletedBy
should be propagated with the current logged-in user.
Can someone tell me, how can I get current user or user-id in my soft-delete-component's SoftCrudRepository
method?
Here is my model:
...ANSWER
Answered 2020-Jul-24 at 14:49Hello from the LoopBack team 👋
Assuming you are using LoopBack's builtin authentication & security layer (see https://loopback.io/doc/en/lb4/Authentication-overview.html), the currently logged-in user can be injected using SecurityBindings.USER
.
The simplest option is to uses property injection as follows:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install loopback4-soft-delete
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page