I've started out with the Silverlight 4 开发者_如何学PythonNavigation Application template (RIA Services enabled). (As I really don't like the bloated Business Application Template) I've added an Authentication Service and I'm able to authenticate users, but want to override the User.IsInRole method.
WebContext.Current.User.IsInRole("Guest");
But I cannot find any place to override the behaviour.
What are you trying to do? User.IsInRole is an implementation of IPrincipal.IsInRole and really shouldn't be overridden.
If you want to set the user roles, you can do it on the server in your AuthenticationService by overridding the GetAuthenticatedUser or GetAnonymousUser methods.
If you want a method similar to IsInRole, you can extend the User type with a partial class on the client and add whatever methods make sense.
精彩评论