I have a service which will override the content of the response body.
is it possible to use themed within the method which override the content ?
[Themed]
No, i don't think this will work as the Themed
attribute is intended for decorating a controller only.
Also i don't think you follow the right approach for denying access. The event handler should not override the response body (seperation of concerns and it most likely won't work anyway). The IAuthorizationServiceEventHandler
should check permissions and return whether access is granted or not. What`s happening when a permission is granted or not granted is normally a concern of other code parts. I would go this route:
IAuthorizationServiceEventHandler
to implement the checks accordingly