You were given instructions to develop a print driver license. The component that you will use should grant permission to access all the printers that are connected to the client computers. What should you do to step by step specify security to make sure that applications cannot use your component unless they are granted an unrestricted printing permission?
A.
Call the Demand method on a PrintingPermission instance with the Level property set to PrintingPermissionLevel.AllPrinting.
B.
Call the Demand method on a PrintingPermission instance with the Level property set to PrintingPermissionLevel.NolPrinting.
C.
Call the Assert method on a PrintingPermission instance with the Level property set to PrintingPermissionLevel.AllPrinting.
D.
Call the Assert method on a PrintingPermission instance with the Level property set to PrintingPermissionLevel.NoPrinting.
Explanation:
When using the Demand method, ill demand the callers in a higher stack a specific permission. The applications that are granted unrestricted printing permissions can use the print driver license.Incorrect Answers:
B: The Demand method on a PrintingPermission is the same as permission to print. C, D: The Assert method, you can make sure that the code is secure and prevent a full stack walk from whether all callers in the call stack are granted the permission.