nerdexam
Microsoft

70-573 · Question #60

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

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 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.AllowUnsafeUpdates= true;
  • Cweb.CurrentUser.RequireRequestToken = false;
  • Dweb.ValidateFormDigest();

How the community answered

(19 responses)
  • A
    79% (15)
  • B
    5% (1)
  • C
    11% (2)
  • D
    5% (1)

Explanation

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

Topics

#elevated privileges#RunWithElevatedPrivileges#DoesUserHavePermissions#Web Part security

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice