Show / Hide Table of Contents

Interface IUserAndGroupStore

Functionality for working with AAD users and groups.

Namespace: Microsoft.GNS.Roster.DataAccess
Assembly: Microsoft.GNS.Roster.DataAccess.dll
Syntax
public interface IUserAndGroupStore

Methods

View Source

FindGroupsAsync(string, int)

Searches the group graph on displayName and mail.

Declaration
IAsyncEnumerable<Group> 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<Group>

Returns a filtered list of RosterSecurityGroup types generated from the graph.

View Source

FindUsersAsync(string, int)

Searches the user graph on displayName and mail.

Declaration
IAsyncEnumerable<User> 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<User>

Returns a filtered list of RosterUser types generated from the graph.

View Source

GetCurrentUserAsync()

Gets the currently logged in user.

Declaration
Task<User?> GetCurrentUserAsync()
Returns
Type Description
Task<User>

A Microsoft.Graph.User object.

View Source

GetSecurityGroupAsync(string)

Gets a security group.

Declaration
Task<Group?> GetSecurityGroupAsync(string groupIdentifier)
Parameters
Type Name Description
string groupIdentifier

The AAD group Id or group name or group email.

Returns
Type Description
Task<Group>

A Microsoft.Graph.Group object.

View Source

GetUserAsync(string)

Gets a user profile.

Declaration
Task<User?> GetUserAsync(string principalName)
Parameters
Type Name Description
string principalName

The email formatted principal name. i.e. alias@microsoft.com.

Returns
Type Description
Task<User>

A Microsoft.Graph.User object.

View Source

IsMemberOfOffice365GroupAsync(string, string)

Check if a user is a member of an Office 365 group in AAD.

Declaration
Task<bool> IsMemberOfOffice365GroupAsync(string principalName, string groupName)
Parameters
Type Name Description
string principalName

The email formatted principal name. i.e. alias@microsoft.com.

string groupName

An Office 365 group name.

Returns
Type Description
Task<bool>
View Source

IsMemberOfSecurityGroupAsync(Guid)

Checks if a user is a member of a security group.

Declaration
Task<bool> IsMemberOfSecurityGroupAsync(Guid groupId)
Parameters
Type Name Description
Guid groupId

The principal Id of the group in which to check membership.

Returns
Type Description
Task<bool>

True if the user is the member of a group. Otherwise, false.

View Source

IsMemberOfSecurityGroupAsync(string, string)

Checks if a user is a member of a security group.

Declaration
Task<bool> IsMemberOfSecurityGroupAsync(string principalName, string groupName)
Parameters
Type Name Description
string principalName

The email formatted principal name. i.e. alias@microsoft.com.

string groupName

An AAD group name.

Returns
Type Description
Task<bool>

True if the user is the member of a group. Otherwise, false.

  • View Source
In this article
Back to top Generated by DocFX