70-573 · Question #258
You create a Visual Web Part in SharePoint Server 2010. You need to ensure that the Web Part can access the local file system on the SharePoint server. You must minimize the amount of privileges…
The correct answer is C. Create a custom code access security (CAS) policy. MNEMONIC RULE: "access the local file system = custom code access" WSS_Medium will give you access to System.Security.Permissions.FileIOPermission, but it'll also give youaccess to a few other assemblies/namespaces. If the goal is to minimize the amount of privileges, then CAS…
Question
You create a Visual Web Part in SharePoint Server 2010. You need to ensure that the Web Part can access the local file system on the SharePoint server. You must minimize the amount of privileges assigned to the Web Part. What should you do?
Options
- AElevate the trust level to Full.
- BElevate the trust level to WSS_Medium.
- CCreate a custom code access security (CAS) policy.
- DDeploy the Web Part to the Global Assembly Cache (GAC).
How the community answered
(31 responses)- A10% (3)
- B13% (4)
- C74% (23)
- D3% (1)
Explanation
MNEMONIC RULE: "access the local file system = custom code access" WSS_Medium will give you access to System.Security.Permissions.FileIOPermission, but it'll also give youaccess to a few other assemblies/namespaces. If the goal is to minimize the amount of privileges, then CAS is the way to go. Securing Web Parts in SharePoint Foundation
Topics
Community Discussion
No community discussion yet for this question.