Access user claims + set attributes of called method in Global Query filter
Hello! I was wondering whether it is possible to access what API Controller & what method is called in the IHttpContextAccessor (when using it in a global query filter in the app its DbContext).
If not with the ihttpcontextaccessor, is there any other way of doing this?
(Basically: I would like to access my user’s claims (using the httpcontext). With that, I would like to check the [Attributes] set on the called method. Then I would like to filter if certain properties in both match, and based on that outcome, apply certain id(s) to filter for in the request.
That’s also why I need it in a global query filter. I dont want to copypaste this code everywhere.)
- As well as all the attributes which are set above those controllers/methods. Both are very needed.
If not with the ihttpcontextaccessor, is there any other way of doing this?
(Basically: I would like to access my user’s claims (using the httpcontext). With that, I would like to check the [Attributes] set on the called method. Then I would like to filter if certain properties in both match, and based on that outcome, apply certain id(s) to filter for in the request.
That’s also why I need it in a global query filter. I dont want to copypaste this code everywhere.)