Coming from Laravel Super Admin
SuperAdmin.Rbac ports the auth, role, permission and menu system of the Laravel package. It keeps the same panel look and the same URLs (/admin/auth/users, /admin/auth/roles, /admin/auth/permissions, /admin/auth/menu, /admin/auth/logs).
Scope
The .NET package does not include the Laravel Grid, Form, Show and Tree builders. You build your own pages with MVC, Razor Pages, Minimal APIs or Blazor, and the package protects them and puts them in the menu.
Concept map
| Laravel | ASP.NET Core |
|---|---|
config/admin.php | SuperAdmin section in appsettings.json (or the options callback of AddSuperAdmin) |
php artisan admin:install | AddSuperAdmin(...), UseSuperAdmin(), MapSuperAdmin() and InitializeSuperAdminAsync() in Program.cs |
admin guard (session) | Cookie scheme SuperAdmin |
admin_users, admin_roles, admin_permissions, admin_menu, admin_operation_log | sa_users, sa_roles, sa_permissions + sa_permission_routes, sa_menus, sa_operation_logs |
Permission http_method + http_path | Permission URL rules, one per line. The Laravel style GET,POST:/admin/legacy is accepted |
Role slug administrator | Super administrator flag on any role |
admin.permission:allow,editor | [AllowRoles("editor")] / .AllowRoles("editor") |
admin.permission:deny,guest | [DenyRoles("guest")] |
admin.permission:check,posts.view | [HasPermission("posts.view")] / .RequirePermission("posts.view") |
Admin::user()->can('x') | ICurrentAdmin.CanAsync("x") |
Admin::user()->isRole('x') | ICurrentAdmin.IsInRoleAsync("x") |
auth.excepts | Protection:AnonymousPaths and [AllowAnonymous] |
admin:permissions, admin:generate-menu | The Routes page: create permissions and menu items from your real endpoints |
admin:create-user, admin:reset-password | superadmin seed-admin command, or UserAdminService from code |
operation_log.* | OperationLog:* |
| Menu item roles | Restrict to roles, plus visibility by URL access |
What works differently
The port fixes weaknesses of the original:
| Area | Laravel package | ASP.NET Core |
|---|---|---|
| Login throttle | One global key, so one attacker can lock out every user | Per-IP rate limit plus per-user lockout |
| Sidebar search | Lists all menu links, with no role filter | Searches the already filtered menu |
| Super admin | Hard-coded role slug administrator | IsSuperAdmin flag on a role |
* permission | can('x') ignores *, URL checks honour it | One evaluator: * grants all slugs and all URLs |
| Menu visibility | A menu item with no roles is visible to everyone | Visible only if the user can open its URL, plus optional roles and permission. Empty parents are hidden |
| Data integrity | Pivot tables without keys; deleting a menu can orphan grandchildren | Composite primary keys, foreign keys, cascade rules, full subtree delete |
| Safety rules | "Cannot delete user #1" is UI-only | Server-side rules in the service layer |
| Privilege escalation | A role editor can grant themselves * | Non-super-admins grant only permissions they hold |
| Logout | GET, so any page can log the user out | POST with an antiforgery token |
| Performance | Permissions load from the database on every request | Versioned in-memory cache with precompiled rules |
| First admin | admin / admin | Configured or random password, forced change on first login |
| Operation log | Every method, top-level redaction only, no retention | Write methods by default, recursive redaction, retention |
| URL rules | Newline text with inline METHOD: prefixes | Normalized table, validated on save, {id} segments |
The pattern /posts* keeps its Laravel meaning for compatibility, so it also matches /postsecret. See URL pattern syntax.