Skip to main content

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​

LaravelASP.NET Core
config/admin.phpSuperAdmin section in appsettings.json (or the options callback of AddSuperAdmin)
php artisan admin:installAddSuperAdmin(...), UseSuperAdmin(), MapSuperAdmin() and InitializeSuperAdminAsync() in Program.cs
admin guard (session)Cookie scheme SuperAdmin
admin_users, admin_roles, admin_permissions, admin_menu, admin_operation_logsa_users, sa_roles, sa_permissions + sa_permission_routes, sa_menus, sa_operation_logs
Permission http_method + http_pathPermission URL rules, one per line. The Laravel style GET,POST:/admin/legacy is accepted
Role slug administratorSuper 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.exceptsProtection:AnonymousPaths and [AllowAnonymous]
admin:permissions, admin:generate-menuThe Routes page: create permissions and menu items from your real endpoints
admin:create-user, admin:reset-passwordsuperadmin seed-admin command, or UserAdminService from code
operation_log.*OperationLog:*
Menu item rolesRestrict to roles, plus visibility by URL access

What works differently​

The port fixes weaknesses of the original:

AreaLaravel packageASP.NET Core
Login throttleOne global key, so one attacker can lock out every userPer-IP rate limit plus per-user lockout
Sidebar searchLists all menu links, with no role filterSearches the already filtered menu
Super adminHard-coded role slug administratorIsSuperAdmin flag on a role
* permissioncan('x') ignores *, URL checks honour itOne evaluator: * grants all slugs and all URLs
Menu visibilityA menu item with no roles is visible to everyoneVisible only if the user can open its URL, plus optional roles and permission. Empty parents are hidden
Data integrityPivot tables without keys; deleting a menu can orphan grandchildrenComposite primary keys, foreign keys, cascade rules, full subtree delete
Safety rules"Cannot delete user #1" is UI-onlyServer-side rules in the service layer
Privilege escalationA role editor can grant themselves *Non-super-admins grant only permissions they hold
LogoutGET, so any page can log the user outPOST with an antiforgery token
PerformancePermissions load from the database on every requestVersioned in-memory cache with precompiled rules
First adminadmin / adminConfigured or random password, forced change on first login
Operation logEvery method, top-level redaction only, no retentionWrite methods by default, recursive redaction, retention
URL rulesNewline text with inline METHOD: prefixesNormalized table, validated on save, {id} segments

The pattern /posts* keeps its Laravel meaning for compatibility, so it also matches /postsecret. See URL pattern syntax.