nerdexam
Microsoft

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…

Developing SharePoint Solutions

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)
  • A
    10% (3)
  • B
    13% (4)
  • C
    74% (23)
  • D
    3% (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

#code access security#CAS policy#trust level#Web Part security

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice