2010-02-20 53 views

回答

1

答案是肯定的。 AuthorizeAttribute在內部使用User.IsUserInRole()方法。但是您必須將您的自定義提供程序設置爲默認值。

方案

當角色管理已啓用,RoleManagerModule替換的RolePrincipal新實例HttpContext.User中值。 RolePrincipal在內部也使用Roles.IsUserInRole

相關問題