Microsoft
70-573 · Question #52
You create a Web Part that updates a list. You need to ensure that users can use the Web Part to update the list, regardless of the users' permissions to the list. What should you use in the Web Part?
The correct answer is C. the SPSecurity.RunWithElevatedPrivileges method. MNEMONIC RULE: "regardless of permissions = RunWithElevatedPrivileges" SPSecurity.RunWithElevatedPrivileges Method us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
Developing Business Logic
Question
You create a Web Part that updates a list. You need to ensure that users can use the Web Part to update the list, regardless of the users' permissions to the list. What should you use in the Web Part?
Options
- Athe SPSecurity.AuthenticationMode property
- Bthe SPSecurity.CatchAccessDeniedException property
- Cthe SPSecurity.RunWithElevatedPrivileges method
- Dthe SPSecurity.SetApplicationCredentialKey method
How the community answered
(48 responses)- A17% (8)
- B4% (2)
- C71% (34)
- D8% (4)
Explanation
MNEMONIC RULE: "regardless of permissions = RunWithElevatedPrivileges" SPSecurity.RunWithElevatedPrivileges Method us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
Topics
#elevated privileges#SPSecurity#list permissions#Web Part security
Community Discussion
No community discussion yet for this question.