PrepAway - Latest Free Exam Questions & Answers

Which attribute should you place on the method?

You are developing an application that uses role-based security. The prinicipal policy of the application domain is configured during startup with the following code:
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
You need to restrict access to one of the methods in your application so that only members of the local Administrators group can call the method.
Which attribute should you place on the method?

PrepAway - Latest Free Exam Questions & Answers

A.
[PrincipalPermission (SecurityAction.Demand, Name = @”BUILTINAdministrators”)]

B.
[PrincipalPermission (SecurityAction.Demand, Role = @”BUILTINAdministrators”)]

C.
[PrincipalPermission (SecurityAction.Assert, Name = @”BUILTINAdministrators”)]

D.
[PrincipalPermission (SecurityAction.Assert, Role = @”BUILTINAdministrators”)]

One Comment on “Which attribute should you place on the method?


Leave a Reply