Pages

Showing posts with label SPSecurity.Runwithelevatedprivileges. Show all posts
Showing posts with label SPSecurity.Runwithelevatedprivileges. Show all posts

Tuesday, January 26, 2010

Getting access denied error while updating list items

I was getting access denied error while updating list items, I already tried to put my code into SPSecurity.RunWithElevatedPrivileges delegate, still I was getting error. Below was my actual code.

CODE:

//code line for updating list columns

Listitem.update()

List.Update()

After doing debugging and removing line by line from actual code I have figured out actual problem – the user who has contributor rights(normal user) was getting access denied error, admin users can able to update list without any problem, it’s because of LIST.UPDATE() statement, because contributor rights users don’t have permission to change anything into List settings, they can add/delete list items but they can’t able to change anything into list, after removing LIST.UPDATE() statement from my actual code, all users were able to successfully update the list items.

Enjoy!

Wednesday, June 10, 2009

Anonymous access into SharePoint web services

Till now I didn’t find how to anonymous access web services, we can impersonate our SharePoint object model code by writing block of code under SPSecurity.Runwithelevatedprivileges method, I am looking for something like this for my web services code, I tried to find solution from internet, but I didn’t get success.

 

I can run or authenticate my web service code by passing current user credentials or any custom credentials (user name, password, domain name), but I am looking something different in authentication mode, please reply to me if any of you find some solutions or any alternatives for my challenge problem and I’ll also do same thing.

 

Thank you very much!