I have added a custom ServiceExceptionHandler
to display a bit more information on errors like 'ServiceStack.HttpError: Invalid Role'
. Support staff needs more details:
- User and it’s roles and permissions
- Required roles and permissions of the called service
So 1. I have solved.
But I am stuck with 2. I tried to use Reflection to find CustomAttributes (something like System.Reflection.MemberInfo.GetCustomAttributes(true);
) But this is terrible acrobatics and probably terribly slow too. Is there no smarter way to get this information? I mean it would be very helpful to be able to programmatically query required permissions and roles of every service, but I could not find anything like that.