我正在使用VS2010学习有关MVVM设计模式的Silverlight4业务应用程序。Silverlight4页面和PrincipalPermission
试图弄清楚如何声明性地保护SL4视图(页面或UserControl或ChildWindow)。
我记得在ASP.NET 2.0的Web应用程序中,我可以将PrincipalPermission属性放在我的网页上。
例子:
using System.Security.Permissions;
[PrincipalPermission(SecurityAction.Demand, Authenticated=true, Role="Manager")]
public partial class Default : System.Web.UI.Page
{//blab blab
}
似乎无法做到这一点,在“SL4”项目,因为它甚至不会让我设置为System.Security的引用。
我的谷歌搜索不断返回关于确保WCF方法调用的结果,这与另一层安全性一样好;但我也想在SL视图上进行声明式安全。
任何人有任何想法? (记得我是新SL的发展)
感谢 Sheir