0
jmalla.cp created
- ABP Framework version: v6.0.1
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Auth Server Separated (Angular): Tired
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hi,
Now we are running some processes within a background service, and we need to know which person runs this process. However, when the background service runs the process, it doesn't know the user who launched the background service.
How can I set the user who ran the background service as the current user within the background service?
Thanks
4 Answer(s)
-
0
hi
You can add
userid
to the background job parameters. -
0
Hi,
Yes, I know. But then how can I load the current user from userId?
-
0
hi
You can try:
using (CurrentPrincipalAccessor.Change(new Claim(AbpClaimTypes.UserId, userid))) { //... }
-
0
Great, thanks