开发者

How to override Silvelright 4 RIA Service AuthenticationService User.IsInRole

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜