You are busy creating a component that allows the users in the Finance department to print daily reports. You want the component to grant permission to access all the printers on the client computers of the users. What should you do to programmatically specify security to stop a full stack walk from being performed when the component prints the report?
A.
Call the Demand method on a fully-restricted PrintingPermission instance.
B.
Call the Demand method on an unrestricted PrintingPermission instance.
C.
Call the Assert method on a fully-restricted PrintingPermission instance.
D.
Call the Assert method on an unrestricted PrintingPermission instance.
Explanation:
For you to create an unrestricted PrintingPermission, you should create an instance of the PrintingPermission class and pass the PrintingPermissionLevel.AllPrinting enumeration member or the PermissionState.Unrestricted enumeration member as a parameter.Incorrect Answers:
A, B: The Demand method will demand that a stack walk be performed to find out if all callers higher in the stack have permission to print. This is then done for each document that needs to be printed.