Silverlight Security Context

I am wondering if Silverlight has a security context where you can mark portions of code with [PrincipalPermission(SecurityAction.Demand, Role = "Administrator")].

From all the research that I have collected so far, you have to write a service (or use the nasty RIA shit that they want to complicate) to get the โ€œuser objectโ€ and go back and forth to the user user object (which inherits the object UserBase), which is recognized by both the xaml runtime (silverlight) and the wcf service.

Assuming this is correct, how to restrict access to certain screens in a silverlight application?

How to set the current main security administrator to the same as the user instance returned from the service?

I do not want to reinvent the wheel, and I was hoping that I could use the authorization methods in ASP.NET/Windows inside the silverlight code, decorating the screens with the PrincipalPermission attribute or the silverlight equivalent.

Any help would be greatly appreciated! Thank,

Martin

+5
source share
2 answers

, WebContextBase System.ServiceModel.DomainServices.Client.ApplicationServices.WebContext.WebContextBase( WCF RIA sdk), , . WebContextBase IPrincipal, , , [PrincipalPermission (SecurityAction.Demand, Role = "Administrator" )] .

, - AuthorizationDomainService , .

+1

, , PrincipalPermission .

, , . , , .

, , "", , "" ( ).

, Silverlight .

-1

All Articles