Changelog
All notable changes to SuperAdmin.Rbac. Versions follow SemVer.
0.2.3
Fixed
- The Blazor
SuperAdminMenuandSuperAdminLayoutwrote absolute links (http://host/admin/sync) for menu items, logout, settings and the logo. They now write root-relative links (/admin/sync, or/base/admin/syncunder a path base), the same as the Razor menu. Behind a proxy that terminates HTTPS, links no longer start withhttp://when the app does not read the forwarded headers. UI:Stylesheets: local entries (~/...or/..., also theirMapStaticAssets()fingerprinted URLs) no longer need a login. WithProtection:Scope = Allthe sign-in page could not load them before.
0.2.2
Breaking change in a patch version: the Blazor
<SuperAdminMenu />now renders the sidebar markup. Apps that reference0.2.*get it automatically. For the old list markup, setVariant="SuperAdminMenuVariant.Plain", or pin0.2.1.
Added
- Blazor shell components, so Blazor apps no longer copy the panel markup:
SuperAdminLayout: header, user menu (settings, logout with antiforgery token), sidebar with search and menu, page body. Same markup as_AdminLayout.cshtml. Use it as the layout or nest your own layout in it (@layout SuperAdminLayout).<SuperAdminHead />: the theme CSS,superadmin.css,UI:Stylesheetsand the colour-mode script for<head>. Fingerprinted paths withMapStaticAssets().<SuperAdminScripts />: the Bootstrap bundle andsuperadmin.jsfor<body>.SuperAdminAssets: constants for the package's static file paths.
UI:Stylesheets: extra CSS files loaded after the package CSS on the built-in pages, the sign-in page and<SuperAdminHead />.UI:ColorMode=Light(default),DarkorAuto(followsprefers-color-scheme), through Bootstrap'sdata-bs-theme.- Colour variables in the theme:
--sa-accent,--sa-sidebar-bg,--sa-sidebar-text,--sa-main-bg,--sa-surface-bgand more (README, "Theme and colours"). Each has a dark value. The old names (--menu-bg,--main-bg, ...) still work. theme/: the SCSS source ofstyles.cssand its build (npm run build).
Changed
- Bootstrap 5.3.8 (was 5.1.3), CSS and JS. The theme settings are carried over, so the panel looks the same. New 5.3 classes such as
.text-bg-*are available. - Breaking: the Blazor
<SuperAdminMenu />now renders the panel's sidebar markup (ul#menu, collapsible groups,li.active), styled by the package CSS. For the 0.2 markup (sa-menuclasses,NavLink), setVariant="SuperAdminMenuVariant.Plain". superadmin.jsuses handlers delegated fromdocument, so the sidebar toggle, menu search and confirmations keep working after Blazor re-renders.- Header, cards, tables and the sign-in page use theme variables instead of fixed white backgrounds, so they follow dark mode.
- The theme CSS no longer contains rules for third-party widgets the panel does not use (choices.js, flatpickr, toastify, icon picker, dual list box, grid helpers). Font files that were never shipped (
.eot,.ttf,.svg) are no longer referenced.
Upgrading from 0.2.1 or earlier
- Blazor apps that styled
.sa-menuthemselves: addVariant="SuperAdminMenuVariant.Plain"to<SuperAdminMenu />, or switch toSuperAdminLayout. - Blazor apps that copied the panel layout: replace the copied header and sidebar markup with
@layout SuperAdminLayout, the hard-coded_content/SuperAdmin.Rbac/...links with<SuperAdminHead />and<SuperAdminScripts />, and drop local.text-bg-*CSS (now in Bootstrap 5.3). - Brand colours: move them to a stylesheet listed in
UI:Stylesheetsand use the--sa-*variables.
0.2.0
Added
- Blazor Server support (
AddSuperAdminBlazor()):- a revalidating
AuthenticationStateProvider: deactivation, force logout and password changes also end open circuits (Auth:RevalidationMinutes, default 1); [HasUrlPermission]/ policySuperAdminDefaults.UrlPolicy("sa:url"): checks permission URL rules on every in-circuit navigation throughAuthorizeRouteView. The handler acceptsHttpContext, BlazorRouteData,UrlResourceor a path string;<SaCan Permission="" Roles="" Url="">and<SuperAdminMenu />components;ICurrentAdminreads the current user on each call inside a circuit.
- a revalidating
Auth:SetDefaultScheme: makes theSuperAdmincookie the default scheme for[Authorize],AuthorizeViewandHttpContext.User.Database:Mode=Auto|Create|Migrate|None. Startup now fails fast when a plugin table or column is missing.- SQL scripts for SQL Server, PostgreSQL, MySQL, Oracle and SQLite:
GenerateSuperAdminSqlScript()and, in the package,sql/<provider>/0001_init.sql(install) and0002_user_attributes.sql(upgrade from 0.1.x). All are safe to run again, and the install script also adds columns of newer versions to existing tables. SQL Server scripts setANSI_NULLSandQUOTED_IDENTIFIER. - Tested on SQL Server (LocalDB), PostgreSQL 17, MySQL 9.1 (
MySql.EntityFrameworkCore) and SQLite. Oracle (Oracle.EntityFrameworkCore, 23ai and 19c compatibility) is supported; its scripts and model are covered by checks, not yet by a live database run. Protection:SkipUrlRulesForAssets(defaulttrue):MapStaticAssets()files and Blazor framework requests (/_framework/*,/_blazor,/_blazor/*) need login but no URL rule. Before,Protection:Scope = Allblockedblazor.web.jsfor users without a matching rule, so their circuit never started.- Command line:
RunSuperAdminCommandAsync(args)withsuperadmin seed-adminandsuperadmin sql-script. - User import:
UserInput.PasswordHash(ASP.NET Core Identity v2/v3 hashes),UserInput.Id,UserInput.LockoutEnd. - Extra user fields:
sa_users.Attributes(JSON),UserInput.Attributes,SaUser.GetAttributes(),AccessSnapshot.Attributes. - Events:
ISuperAdminEvents(SignedIn,SignInFailedwith reason,SignedOut,UserChanged,RoleChanged,PermissionChanged,MenuChanged). IOperationLogSinkfor your own audit table, andOperationLog:WriteToDatabase.UI:EnabledandUI:Pages(Account,Management,All) to turn built-in pages off.TimeProvideris used for lockout, cookie expiry, rate limit, timestamps and log retention (replace it in tests).- Source Link, sources embedded in the symbols (
.snupkg) and deterministic CI builds. - A Blazor Server sample (
samples/Sample.Blazor).
Changed
- The plugin uses
IDbContextFactory<SuperAdminDbContext>and one short-lived context per operation, so services are safe in Blazor circuits.SuperAdminDbContextcan still be injected as a scoped service. - All
DateTimevalues are read back asDateTimeKind.Utc. - User and permission search is case-insensitive on every database (it was case-sensitive on PostgreSQL).
- Oracle:
sa_permission_routes.HttpMethodsis nullable (Oracle stores''asNULL), and strings without a maximum length areNCLOBinstead ofNVARCHAR2(2000). Importing users with explicit ids moves the Oracle identity forward. - The generated admin password is no longer logged. Without
Seed:AdminPassword,Developmentprints a random password to the console; other environments create no admin user (usesuperadmin seed-admin). Database:AutoMigrateis obsolete;falsestill works and meansMode = None.
Fixed
- The login page treated a revoked session (stale security stamp) as signed in, redirected to the dashboard and lost
returnUrl. It now clears the stale cookie and shows the form.
Upgrading from 0.1.x
- Database: 0.2.0 adds the nullable column
sa_users.Attributes.ModeAuto/Createwithout migrations: added automatically at startup.- EF Core migrations:
dotnet ef migrations add SuperAdmin020 --context SuperAdminDbContext. - SQL scripts: run
sql/<provider>/0002_user_attributes.sqlfrom the package, or regenerate and re-runGenerateSuperAdminSqlScript(). Until the column exists,Mode = Nonestops the app with "missing sa_users.Attributes".
- 0.1.x wrote the generated admin password to the application log. If you ran 0.1.x without
Seed:AdminPassword, change that admin password and remove the line from stored logs. - Production: set
SuperAdmin:Seed:AdminPassword(or runsuperadmin seed-admin) before the first start on an empty database. - If you construct the management services yourself (not through DI), pass the new constructor arguments.
0.1.0.1, 0.1.0
First releases. Both write a generated admin password to the log; use 0.2.0 or later. 0.1.0.1 is a four-part version; later releases use three-part SemVer.