summaryrefslogtreecommitdiff
path: root/Services/PrincipalProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Services/PrincipalProvider.cs')
-rw-r--r--Services/PrincipalProvider.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Services/PrincipalProvider.cs b/Services/PrincipalProvider.cs
index d37e8c0..4b2cf42 100644
--- a/Services/PrincipalProvider.cs
+++ b/Services/PrincipalProvider.cs
@@ -5,6 +5,16 @@ public interface IPrincipalProvider {
public IUser? GetUser(string name);
public IGroup? GetGroup(string name);
+ /// <summary>
+ /// Perform a search for any principals whose account name
+ /// matches the search term specified by <c>name</c>.
+ /// </summary>
+ /// <returns>
+ /// A list of matching principals or <c>null</c> if the
+ /// provider does not support search functionality.
+ /// </returns>
+ public IPrincipal[]? SearchPrincipals(string name);
+
public IGroup[] GetGroups(IPrincipal principal);
public IGroup[] GetGroups(IPrincipal principal, bool recurse);
@@ -19,6 +29,8 @@ public abstract class PrincipalProvider : IPrincipalProvider {
public abstract IUser? GetUser(string name);
public abstract IGroup? GetGroup(string name);
+ public abstract IPrincipal[]? SearchPrincipals(string name);
+
public IGroup[] GetGroups(IPrincipal principal) =>
GetGroups(principal.Sid, false);
public IGroup[] GetGroups(IPrincipal principal, bool recurse) =>
@@ -28,4 +40,9 @@ public abstract class PrincipalProvider : IPrincipalProvider {
public abstract IGroup[] GetGroups(SecurityIdentifier sid, bool recurse);
public abstract bool ValidatePassword(IUser user, string password);
+
+ public void Test() {
+ var ret = SearchPrincipals("lol");
+ Console.WriteLine(ret);
+ }
}