Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Some methods in IAuthorizationService should be moved to extension methods #11

@victorhurdugaci

Description

@victorhurdugaci

As @Eilon suggested, the overloads without a resource should be extension methods rather than methods on the interface. In most of the cases, whoever implements this service will just call the overload with the resource parameter with a "null" value.

namespace Microsoft.AspNet.Security.Authorization
{
    public interface IAuthorizationService
    {
        bool Authorize(IEnumerable<Claim> claims, ClaimsPrincipal user);
        bool Authorize(IEnumerable<Claim> claims, ClaimsPrincipal user, object resource);
        Task<bool> AuthorizeAsync(IEnumerable<Claim> claims, ClaimsPrincipal user);
        Task<bool> AuthorizeAsync(IEnumerable<Claim> claims, ClaimsPrincipal user, object resource);
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions