blazor sample ujsing cliam policy
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthorization(config =>
{
config.AddPolicy("IsDeveloper", policy => policy.RequireClaim("IsDeveloper", "true"));
});
}
<AuthorizeView Policy="IsDeveloper">
<p>You can only see this if you satisfy the IsDeveloper policy.</p>
</AuthorizeView>
[Route("api/[controller]")]
[ApiController]
public class SystemController
{
[Authorize(Policy = “IsDeveloper”)]
public IActionResult LoadDebugInfo()
{
// ...
}
}
@page "/debug"
@attribute [Authorize(Policy = "IsDeveloper")]
Also in JavaScript:
- send message to specific channel discord.js
- javascript find directory root
- Bitwise Operators js
- how to make a github api using react
- angular event scroll end of page
- how to loop over dom objects javascript
- js isset
- deep clone javascript object
- javascript .tolowercase
- useeffect react
- utiliser les données passees a un modal dans son propre composant en angular
- coin change problem all combinations javascript
- js windowresize event
- react materialize cdn
- how to remove an item from an array in javascript
- javascript mouse drag coordinates
- angular limit string length
- read json data from file
- jquery show hide
- javascript array push object
- responsive grid system angular
- pass variable to regrex literal notation javascript
- es6 node
- retour a la ligne <p> react