// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNet.Identity { /// /// Interface that maps users to their roles /// /// public interface IUserRoleStore : IUserStore where TUser : class { /// /// Adds a user to role /// /// /// /// /// Task AddToRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); /// /// Removes the role for the user /// /// /// /// /// Task RemoveFromRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); /// /// Returns the roles for this user /// /// /// /// Task> GetRolesAsync(TUser user, CancellationToken cancellationToken); /// /// Returns true if a user is in a role /// /// /// /// /// Task IsInRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); /// /// Returns all users in given role /// /// /// /// Task> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken); } }