ππππ
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).
+ As well as all the attributes which are set above those controllers/methods. Both are very needed.
I know I can access the users claims, but I need to know if and how I can access the method with its attributes of the request.
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.)
3 replies