// 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.Tasks;
using Microsoft.Framework.Internal;
namespace Microsoft.AspNet.Authorization
{
///
/// Checks policy based permissions for a user
///
public interface IAuthorizationService
{
///
/// Checks if a user meets a specific set of requirements for the specified resource
///
///
///
///
///
Task AuthorizeAsync(ClaimsPrincipal user, object resource, [NotNull] IEnumerable requirements);
///
/// Checks if a user meets a specific authorization policy
///
/// The user to check the policy against.
/// The resource the policy should be checked with.
/// The name of the policy to check against a specific context.
/// true when the user fulfills the policy, false otherwise.
Task AuthorizeAsync(ClaimsPrincipal user, object resource, [NotNull] string policyName);
}
}