Security API | Blazor (Blazor)

When security is enabled Radzen will inject an instance of the SecurityService class in all pages. It is available as the Security property.

Security methods

IsAuthenticated

Returns true if the user is authenticated (logged in); otherwise false;

Use it in Radzen as ${Security.IsAuthenticated()}.

IsInRole

Returns true if the user is from the specified role(s) or Administrator; otherwise false;

Use it in Radzen as ${Security.IsInRole("Sales")}.

Security properties

User

Returns the current ApplicationUser instance.

Use it in Radzen as ${Security.User.Email}.

Check Extend Application User for instructions about adding custom properties to the user.