Interface IUserAndGroupDAL
Functionality for working with AAD users and groups.
Namespace: Microsoft.GNS.Roster.DataAccess
Assembly: Microsoft.GNS.Roster.DataAccess.dll
Syntax
public interface IUserAndGroupDAL
Methods
View SourceFindGroupsAsync(string, int)
Searches the group graph on displayName and mail.
Declaration
IAsyncEnumerable<IRosterSecurityGroup> FindGroupsAsync(string principalName, int maxSearchResults)
Parameters
Type | Name | Description |
---|---|---|
string | principalName | Term to do a startsWith search against Email or Display Name. |
int | maxSearchResults | Maximum number of results to return. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterSecurityGroup> | Returns a filtered list of RosterSecurityGroup types generated from the graph. |
FindUsersAsync(string, int)
Searches the user graph on displayName and mail.
Declaration
IAsyncEnumerable<IRosterUser> FindUsersAsync(string principalName, int maxSearchResults)
Parameters
Type | Name | Description |
---|---|---|
string | principalName | Term to do a startsWith search against Email or Display Name. |
int | maxSearchResults | Maximum number of results to return. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterUser> | Returns a filtered list of RosterUser types generated from the graph. |
GetCurrentUserAsync()
Gets the currently logged in user.
Declaration
Task<IRosterUser> GetCurrentUserAsync()
Returns
Type | Description |
---|---|
Task<IRosterUser> | A IRosterUser object. |
GetSecurityGroupAsync(string)
Gets a security group.
Declaration
Task<IRosterSecurityGroup> GetSecurityGroupAsync(string groupIdentifier)
Parameters
Type | Name | Description |
---|---|---|
string | groupIdentifier | The AAD group Id or group name or group email. |
Returns
Type | Description |
---|---|
Task<IRosterSecurityGroup> | A IRosterSecurityGroup object. |
GetUserAsync(string)
Gets a user profile.
Declaration
Task<IRosterUser> GetUserAsync(string principalNameOrId)
Parameters
Type | Name | Description |
---|---|---|
string | principalNameOrId | The email formatted principal name or principal ID. i.e. alias@microsoft.com. |
Returns
Type | Description |
---|---|
Task<IRosterUser> | A IRosterUser object. |
IsCurrentUserMemberOfSecurityGroupAsync(Guid)
Determines if the current user is a member of a security group.
Declaration
Task<bool> IsCurrentUserMemberOfSecurityGroupAsync(Guid groupId)
Parameters
Type | Name | Description |
---|---|---|
Guid | groupId | The security group Id in which to check membership. |
Returns
Type | Description |
---|---|
Task<bool> | True if the current user is a member. Otherwise, false. |