Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created July 6, 2020 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/a5a3f6c6a6190f5d263fea12ed2a7961 to your computer and use it in GitHub Desktop.
Save xximjasonxx/a5a3f6c6a6190f5d263fea12ed2a7961 to your computer and use it in GitHub Desktop.
services.AddAuthorization(options =>
{
options.AddPolicy("IsWeatherman", policy => policy.Requirements.Add(new IsWeathermanAuthorizationRequirement()));
});
services.AddSingleton<IAuthorizationHandler, IsWeathermanAuthorizationHandler>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment