// Copyright (c) .NET Foundation. 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.Security.Claims; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNet.Identity { /// /// Provides an abstraction for a store of role specific claims. /// /// The type encapsulating a role. public interface IRoleClaimStore : IRoleStore where TRole : class { /// /// Gets a list of s to be belonging to the specified as an asynchronous operation. /// /// The role whose claims to retrieve. /// The used to propagate notifications that the operation should be canceled. /// /// A that represents the result of the asynchronous query, a list of s. /// Task> GetClaimsAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken)); /// /// Add a new claim to a role as an asynchronous operation. /// /// The role to add a claim to. /// The to add. /// The used to propagate notifications that the operation should be canceled. /// The task object representing the asynchronous operation. Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); /// /// Remove a claim from a role as an asynchronous operation. /// /// The role to remove the claim from. /// The to remove. /// The used to propagate notifications that the operation should be canceled. /// The task object representing the asynchronous operation. Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); } }