PrepAway - Latest Free Exam Questions & Answers

Which code segment should you add to the Web Part?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
RunWithElevatedPrivileges

B.
web.AllowUnsafeUpdates= true;

C.
web.CurrentUser.RequireRequestToken = false;

D.
web.ValidateFormDigest();

Explanation:
MNEMONIC RULE: “DoesUserHavePermissions = RunWithElevatedPrivileges”

You need to elevate your privileges to check on current user’s permissions.

DoesUserHavePermissions?
http://www.shannonbray.com/2010/01/doesuserhavepermissions.html


Leave a Reply