Skip to content
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 opened this issue Jun 23, 2017 · 1 comment
Closed

Passing in an AuthoritizationPolicy allocates an array everytime #1274

davidfowl opened this issue Jun 23, 2017 · 1 comment
Assignees
Milestone

Comments

@davidfowl
Copy link
Member

davidfowl commented Jun 23, 2017

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

@HaoK HaoK self-assigned this Jun 27, 2017
@HaoK HaoK added this to the 2.0.0 milestone Jun 27, 2017
@HaoK
Copy link
Member

HaoK commented Jun 27, 2017

8038360

@HaoK HaoK closed this as completed Jun 27, 2017
@HaoK HaoK added 3 - Done and removed 2 - Working labels Jun 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants