diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-10-05 16:47:49 +1100 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-10-05 16:47:49 +1100 |
| commit | 2c6e3aa4456811a3d6412fc10019012a900eb6a0 (patch) | |
| tree | d0616bbe573a4abe5aaf9f80e7960a40352967b8 /Services | |
| parent | 035d2e3858dd55580c294031573c3be9e1999449 (diff) | |
| parent | 3d5f6e47bd74ce77d5ec253f51b7cef1b42099ef (diff) | |
Merged security
Diffstat (limited to 'Services')
| -rw-r--r-- | Services/PrincipalProvider.cs | 17 |
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); + } } |
