nerdexam
Microsoft

70-573 · Question #112

70-573 Question #112: Real Exam Question with Answer & Explanation

Sign in or unlock 70-573 to reveal the answer and full explanation for question #112. The question stem and answer options stay visible for context.

Question

You create a Web Part that queries a list. The Web Part contains the following code segment. (Line numbers are included for reference only.) 01Protected Overloads Overrides Sub Render(ByVal writer As HtmlTextWriter) 02 Dim spInToken As SPUserToken = GetTheContext(SPContext.Current.Site) 03 Using aSite As New SPSite(curSiteCtx.ID, spInToken) 04 ... 05 End Using 06 End Sub 07Private Function GetTheContext(ByVal nWeb As SPSite) As SPUserToken 08 nWeb.CatchAccessDeniedException = False 09 Dim spToken As SPUserToken = Nothing 10 Try 11 spToken = nWeb.SystemAccount.UserToken 12 Catch generatedExceptionName As UnauthorizedAccessException 13 14 End Try 15 Return spToken 16End Function You need to ensure that users without permissions to the list can view the contents of the list from the Web Part. Which code segment should you add at line 13?

Options

  • ASPSecurity.RunWithElevatedPrivileges(EvelvatedSub)
  • BSPSecurity.RunWithElevatedPrivileges(EvelvatedSub)
  • CspToken = nWeb.RootWeb.AllUsers(SPContext.Current.Web.Name).UserToken
  • DspToken = nWeb.RootWeb.AllUsers(SPContext.Current.Web.Name).UserToken

Unlock 70-573 to see the answer

You've previewed enough free 70-573 questions. Unlock 70-573 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 70-573 Practice