Project Structure: Blazor Automode, .Net 8
To create a page in a blazor project you use:
@page "yourUrl"
I want to create my own page attribute for the exact permissions to be able acess a page like:
@page "/user/crud"
//this line below is what i believe it would be, but currently does not work
@permissions "[userRead, userWrite]"
Does exists a way to make it work? If so, how?
I’ve tried researching but the only seggestion i found was:
using System;
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public class MyCustomAttribute : Attribute
{
public string Title { get; set; }
}
@MyCustomAttribute(Title = "My Custom Page Title")
@page "/my-page"
<h1>Welcome to my custom page!</h1>
But basically does not work.