nerdexam
Microsoft

70-573 · Question #120

You plan to develop a Web Part that displays a SharePoint list. The Web Part will verify the list permissions when users access it by using the web.CurrentUser.DoesUserHavePermissions method. You…

The correct answer is A. RunWithElevatedPrivileges. MNEMONIC RULE: "DoesUserHavePermissions = RunWithElevatedPrivileges" You need to elevate your privileges to check on current user's permissions. DoesUserHavePermissions?

Developing Business Logic

Question

You plan to develop a Web Part that displays a SharePoint list. The Web Part will verify the list permissions when users access it by using the web.CurrentUser.DoesUserHavePermissions method. You need to ensure that when users do not have permissions to the list, the Web Part displays the company's logo. Which code segment should you add to the Web Part?

Options

  • ARunWithElevatedPrivileges
  • Bweb.ValldateFormDigest();
  • Cweb.CurrentUser.RequireRequestToken = false;
  • Dweb.AllowUnsafeUpdates= true;

How the community answered

(29 responses)
  • A
    72% (21)
  • B
    3% (1)
  • C
    10% (3)
  • D
    14% (4)

Explanation

MNEMONIC RULE: "DoesUserHavePermissions = RunWithElevatedPrivileges" You need to elevate your privileges to check on current user's permissions. DoesUserHavePermissions?

Topics

#RunWithElevatedPrivileges#permissions#Web Part security#access control

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice