SuperAdmin.Rbac for ASP.NET Core
SuperAdmin.Rbac adds role-based authentication, URL-based permissions and a role-aware sidebar menu to an ASP.NET Core app. You manage everything at runtime from a built-in admin panel: users, roles, permissions, URL rules and the menu. You do not need a code change or a redeploy to change who can do what.
Supported: .NET 10 (LTS) · MVC, Razor Pages, Minimal APIs, Blazor Server · SQL Server, PostgreSQL, MySQL, Oracle, SQLite
dotnet add package SuperAdmin.Rbac

It is a port of the auth, role, permission and menu system of the Laravel Super Admin package. It keeps the same look and the same URLs (/admin/auth/users, /admin/auth/roles, ...) and fixes the weaknesses of the original. See Coming from Laravel.
Features
| Feature | Details |
|---|---|
| Login | Cookie scheme SuperAdmin, remember me, per-user lockout, per-IP rate limit, forced password change, POST-only logout |
| URL permissions | Every request under /admin (or the whole app) is checked against permission URL rules (GET,POST /admin/posts/{id}/edit) |
| Roles | Assign permissions to roles, roles to users, plus direct user permissions. Super-admin roles bypass checks |
| Menu | Database menu tree. Each user sees only items whose URL they may open (plus optional role and permission restrictions) |
| Admin panel | Users, user access view, roles, permissions, URL tester, menu editor, route discovery, operation log |
| Code API | [HasPermission], [AllowRoles], [DenyRoles], [SkipUrlPermission], [HasUrlPermission], Minimal API helpers, ICurrentAdmin, <sa-can> tag helper |
| Blazor Server | AddSuperAdminBlazor(): revalidating auth state, URL checks on in-circuit navigation, <SaCan>, <SuperAdminMenu /> and the panel shell (SuperAdminLayout, <SuperAdminHead />, <SuperAdminScripts />) |
| Audit and hooks | Operation log of write requests with secret redaction and retention, ISuperAdminEvents, custom IOperationLogSink |
| Database | Any EF Core relational provider, configurable table prefix and schema, create/migrate/script modes, install and upgrade SQL scripts |
Where to start
| You want to... | Read |
|---|---|
| Add the package to an app | Installation, then Quick start |
| Understand how a request is allowed or denied | How access works |
| Give a role access to your own pages without code | Protect your pages |
| Use the admin panel day to day | Admin panel guide |
| Check permissions in controllers, views or services | Attributes and Minimal APIs, Razor, ICurrentAdmin and menu |
| Use it in Blazor Server | Blazor Server |
| Pick a database or ship SQL scripts | Databases, Migrations and SQL scripts |
| Change the look | Customize the UI, Theme and colours |
| Go to production | Security |