c# - Access denied when using RunWithElevatedPrivileges? -


I think that a regular user can use the MySite Root Site "User Information List". I'm still using the "RunWithElevatedPrivileges" method still denied entry error. For example, my root site collection for mysite is "". Users want to rate this user's information. How can he reach?

  Spisakwayrikrnvibhinn Elivetejh (representatives using {(SPS ite site = new SPS ite (SPContext.Current.Web.Site.ID)) {ServerContext sc = ServerContext.Current; UserProfileManager Upm = new UserProfileManager (sc); UserProfile up = null; // the current user receives the profile (visitors) if (upm.UserExists (SPContext.Current.Web.CurrentUser.LoginName)) {up = upm.GetUserProfile (SPContext.Current. Web.CurrentUser.LoginName); SPWeb web = SPContext.Current.Web; SPList userInformationList = web.Lists [ "user information list"];  

SPContext.Curr ent Rnveitileted Praivlsjh elevated runs out of context. See blog post for more information.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -