1

Am writing an event receiver for which only the assignedto person or some special SharePoint groups are getting the access to the particular Item. this is written in my itemadded and itemupdated eventhandler methods.

But when I am a user who doesn't have access to this item in the document library or splist, I am getting the error:

"No item exists at ... It may have been deleted or renamed by another user"

how can I mitigate this? What error handling mechanism I need to apply for removing this error and show some user-friendly error or any other meaningful approaches.

Can I show some user-friendly error like "you don't have access to this document/item" when an unauthorized user tries to access the item and redirect to the list view page or home page?

as per this blog http://blog.sharepointalist.com/2013/03/sharepoint-2013-event-receiver-redirect.html , sputilitty.redirect wont work and am using itemupdated event only. so i cant user csrrendermode as well.

noitemexists_unauthorizeduser

  • have you tried to run your code with elevated privileges ? – Vishwas Goswami May 29 '17 at 11:27
  • yes, am already running with my runwithelevatedprivilges.the issue is , for an athorized , who has the access [ assignedto field and some SPgroups are getting the access to this item and they are able to see the metadata. but if an unauthorized user logs in, he is getting this deadly yelo color error. my question, is how can i redirect the unauthorized user or how can i provide a meaningfull /userfriendly message to the unauthorized user , that "access denied" OR "you are not authorized to view this page" ... – SaMolPP May 29 '17 at 12:07
  • can anyone provide a solution for this? i am stuck with this ! Though i am trying to use spurility.redirect(in the catch block aftre loging exception into ULS,) , but will fail as that approach is only for SP 2010. not for SP 2013. any other approaches? – SaMolPP May 29 '17 at 19:16
  • can you paste your code snippets? – Vishwas Goswami May 30 '17 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.