This project has moved and is read-only. For the latest updates, please go here.

Query within site collection

Mar 6, 2016 at 6:52 PM
I would like the picker to only return users who are in the site collection where the user is performing the search from. Which method do I need to override to filter the results?
Mar 9, 2016 at 12:29 PM
LDAPCP cannot help you for that: when it is called, assuming it is configured for this web app/zone, LDAPCP should always return results if it can.
What you want is to find a way so that SharePoint does NOT call LDAPCP, that's not Something you can achieve by overriding any method in LDAPCP.
Mar 9, 2016 at 12:43 PM
What if I override the FillSearch function with the same exact code found in the LDAPCP base class function, but instead of adding every returned user to the searchtree hierarchy, I ignore those that are not in the site collection? Would that not work?

// On purpose, if this property is true, LDAP lookp is completely bypassed
List<PickerEntity> entities = CreatePickerEntityForSpecificClaimTypes(
attributes.FindAll(x => !x.CreateAsIdentityClaim),

if (results != null && results.Count > 0)
foreach (var result in results)
  __# Check if current user exists in site collection. If true, execute__:
Mar 9, 2016 at 4:45 PM
Edited Mar 9, 2016 at 4:46 PM
Hmm, yes, I think that scenario will work.
I'm just not sure if FillSearch will be called on every scenario where you want to restrict the permissions returned, maybe you'll have to override FillResolve([...]string[...]) as well.
But in any case, you should not override FillResolve([...]SPClaim[...])

Quick question for you: would that help if LDAPCP had an overridable method that would always be called after permissions are created, but before they are added to the list (so that you have a chance to remove the ones already created, and add new ones)?

Mar 9, 2016 at 7:02 PM
Absolutely that would help. It would give me the chance to remove the permissions for all the users who are not members of the site collection before displaying them in the list. If I can get the context uri of the site collection inside this overloaded method, then I'll be set.

I agree with you that the FillSearch will not cover every scenario for me, and that I would have to override FillResolve also. I wanted to take it one step a time, and get it working for FillSearch first before I tackled other methods. I actually tried overriding FillSearch today but I ran into an exception, and did not mess around too much with it. If you provide an overridable method that I can use, then I don't even need to mess around with overriding FillSearch or FillResolve. I'll just remove the permissions that I don't need and then return the updated permission collection back to the base class for display in the list. That would be great!

Mar 10, 2016 at 4:09 PM
Ok :)
I will implement it, but I don't want to commit on any timeframe when it will be available.
Mar 11, 2016 at 12:53 AM
Edited Mar 11, 2016 at 12:54 AM
Fantastic! I will be anxiously awaiting :)

Thanks, Yvan.
Mar 25, 2016 at 5:19 PM
for your information, I implemented this in the next version and it should be available soon (let's say within 1 month).
Mar 29, 2016 at 4:08 PM
for your information, the update is available :)
You want to override FillPermissions in your inherited class to change / remove permissions created by LDAPCP, or add new ones.
Please let me know if you have some feedback or experience any issue.
Marked as answer by Yvand on 3/24/2017 at 3:02 AM
Apr 4, 2016 at 6:18 PM
Great!!! I will go ahead and download the update this evening and test it out.

Thank you once again for implementing this and making it available quicker than I expected. Very thankful for all your efforts on this, Yvan.
Apr 5, 2016 at 12:34 PM
Thank you for your great feedback!
Please let me know if you have any issue, and feel free to rate the project (from the homepage) to show your satisfaction about it :)
Mar 23, 2017 at 3:31 PM

I am interresting too by this features, I don't find it in the last version, How use it ?

Mar 24, 2017 at 11:03 AM
Hello, it's already available and you can implement this as described in my post above from Mar 29, 2016 (I just marked it as answer).