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?
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)- A79% (15)
- B5% (1)
- C11% (2)
- D5% (1)
Explanation
MNEMONIC RULE: "DoesUserHavePermissions = RunWithElevatedPrivileges" You need to elevate your privileges to check on current user's permissions. DoesUserHavePermissions?
Topics
Community Discussion
No community discussion yet for this question.