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.

Passing in an AuthoritizationPolicy allocates an array everytime #1274

Closed
@davidfowl

Description

@davidfowl

return service.AuthorizeAsync(user, resource, policy.Requirements.ToArray());

It would be great if there was a way to avoid this allocation per call. AuthorizationPolicy already has an IReadOnlyList<Requirements>

public IReadOnlyList<IAuthorizationRequirement> Requirements { get; }
, yet we allocate a mutable array every time we need to check if a user is authorized.

/cc @HaoK

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions