TagHelperPack
TagHelperPack copied to clipboard
AuthZ: Not Authorized By Policy
I recently encountered a situation where I wanted to show something if the user doesn't satisfy a policy, e.g.
<button class="btn" asp-authz-policy="AdminPolicy>Delete</button>
<span class="btn btn-disabled" asp-authz-not-policy="AdminPolicy">Delete</span>
Does asp-authz-not-policy
seem reasonable to implement?
Sure, it would just be checking if the user doesn't pass a given authz policy.