Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. protected override void FillClaimsForEntity(Uri context, SPClaim entity, List<SPClaim> claims)
  2. {
  3. if (entity == null) throw new ArgumentException("entity");
  4. if (claims == null) throw new ArgumentException("claims");
  5.  
  6.  
  7. var userLoginEncoded = SPUtility.FormatAccountName("i", entity.Value);
  8. var userLogin = SPClaimProviderManager.Local.DecodeClaim(userLoginEncoded).Value;
  9.  
  10. if (userLogin.IndexOf("nt", StringComparison.InvariantCultureIgnoreCase) >= 0)
  11. {
  12. return;
  13. }
  14.  
  15.  
  16. SPSecurity.RunWithElevatedPrivileges(() =>
  17. {
  18. using (var site = new SPSite(context.ToString()))
  19. {
  20. var serviceContext = SPServiceContext.GetContext(site);
  21. var profileManager = new UserProfileManager(serviceContext);
  22. }
  23. });
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement