Our.Umbraco.Lockdown.Core
1.0.0-beta.1
dotnet add package Our.Umbraco.Lockdown.Core --version 1.0.0-beta.1
NuGet\Install-Package Our.Umbraco.Lockdown.Core -Version 1.0.0-beta.1
<PackageReference Include="Our.Umbraco.Lockdown.Core" Version="1.0.0-beta.1" />
<PackageVersion Include="Our.Umbraco.Lockdown.Core" Version="1.0.0-beta.1" />
<PackageReference Include="Our.Umbraco.Lockdown.Core" />
paket add Our.Umbraco.Lockdown.Core --version 1.0.0-beta.1
#r "nuget: Our.Umbraco.Lockdown.Core, 1.0.0-beta.1"
#:package Our.Umbraco.Lockdown.Core@1.0.0-beta.1
#addin nuget:?package=Our.Umbraco.Lockdown.Core&version=1.0.0-beta.1&prerelease
#tool nuget:?package=Our.Umbraco.Lockdown.Core&version=1.0.0-beta.1&prerelease
🔒 Our.Umbraco.Lockdown.Core
Core server-side functionality for the Umbraco Lockdown package. This package provides the essential services, models, and infrastructure needed to implement content lockdown functionality in Umbraco CMS.
📋 Overview
Our.Umbraco.Lockdown.Core
is the foundational package that provides server-side lockdown functionality for Umbraco CMS. It includes the core services, notification handlers, and infrastructure components that enable content lockdown during maintenance periods.
🎯 Purpose
This core package is designed to be consumed by the main Our.Umbraco.Lockdown package and provides:
- Lockdown State Management: Core service for toggling and managing lockdown state
- Content Protection: Notification handlers that prevent content modifications during lockdown
- Real-time Communication: SignalR integration for broadcasting lockdown state changes
- Persistent Storage: Settings service integration for storing lockdown configuration
- Middleware Support: Login page integration for maintenance messaging
🏗️ Architecture
Core Services
ILockdownService
/ LockdownService
The primary service for managing lockdown functionality:
public interface ILockdownService
{
bool IsLockedDownActive { get; }
Task ToggleLockdown(bool enable);
}
Features:
- Toggle lockdown state on/off
- Real-time state broadcasting via SignalR
- Persistent state storage using Umbraco's key-value settings
IKeyValueSettingsService
/ KeyValueSettingsService
Handles persistent storage of lockdown configuration using Umbraco's key-value settings system.
Models
LockdownState
Simple state model for tracking lockdown status:
public class LockdownState
{
public bool Enabled { get; set; }
}
Notification Handlers
The core package includes comprehensive notification handlers that prevent content modifications during lockdown:
Content Handlers
ContentSavingNotificationHandler
- Prevents content saving during lockdownContentPublishingNotificationHandler
- Prevents content publishing during lockdownContentUnPublishingNotificationHandler
- Prevents content unpublishing during lockdownContentDeletingNotificationHandler
- Prevents content deletion during lockdownContentMovingNotificationHandler
- Prevents content moving during lockdownContentCopyingNotificationHandler
- Prevents content copying during lockdown
Media Handlers
- Similar protection for media operations (structure varies by implementation)
Infrastructure Components
LockdownHub
SignalR hub for real-time communication of lockdown state changes to connected clients.
LockdownLoginMiddleware
Middleware component that injects maintenance messages into login pages during lockdown.
LockdownComposer
Dependency injection composer that registers all core services with Umbraco's DI container.
LockdownStartupFilter
Application startup filter for configuring the middleware pipeline.
LockdownApiController
API controller providing endpoints for lockdown management (used by the main package).
🚀 Installation
This package is automatically included as a dependency when you install the main Our.Umbraco.Lockdown
package. For direct installation:
Via NuGet Package Manager
Install-Package Our.Umbraco.Lockdown.Core
Via .NET CLI
dotnet add package Our.Umbraco.Lockdown.Core
📖 Usage
Basic Service Integration
// Inject the lockdown service
public class MyController : Controller
{
private readonly ILockdownService _lockdownService;
public MyController(ILockdownService lockdownService)
{
_lockdownService = lockdownService;
}
public async Task<IActionResult> ToggleLockdown(bool enable)
{
await _lockdownService.ToggleLockdown(enable);
return Ok();
}
}
Checking Lockdown Status
if (_lockdownService.IsLockedDownActive)
{
// Handle locked down state
return BadRequest("System is in maintenance mode");
}
Custom Notification Handlers
You can extend the lockdown functionality by creating custom notification handlers:
public class CustomLockdownHandler : INotificationHandler<ContentSavingNotification>
{
private readonly ILockdownService _lockdownService;
public CustomLockdownHandler(ILockdownService lockdownService)
{
_lockdownService = lockdownService;
}
public void Handle(ContentSavingNotification notification)
{
if (_lockdownService.IsLockedDownActive)
{
notification.Cancel = true;
notification.Messages.Add(new EventMessage("Lockdown", "Content saving is disabled during maintenance", EventMessageType.Error));
}
}
}
🔧 Configuration
Constants
The package defines constants for consistent key usage:
public static class Constants
{
public const string SettingsKey = "Our.Umbraco.Lockdown";
// Additional constants as needed
}
Dependency Injection
The package automatically registers all services with Umbraco's DI container through the LockdownComposer
. No additional configuration is required.
🔄 Dependencies
- Umbraco.Cms.Core (v13.8.1) - Core Umbraco functionality
- Umbraco.Cms.Web.BackOffice (v13.8.1) - Backoffice integration
- GitVersion.MsBuild (v6.3.0) - Version management
🛠️ Development
Prerequisites
- .NET 8.0 or later
- Umbraco CMS v13
Building
dotnet build src/Our.Umbraco.Lockdown.Core/Our.Umbraco.Lockdown.Core.csproj
Testing
The core package is tested as part of the main package's test suite.
📦 Package Information
- Package ID:
Our.Umbraco.Lockdown.Core
- Target Framework: .NET 8.0
- License: MIT
- Authors: Simon Dingley
- Company: Prolific Notion Ltd
🔗 Related Packages
- Our.Umbraco.Lockdown - Main package that consumes this core functionality
- Our.Umbraco.Lockdown.UI.Client - Frontend UI components
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- Issues: Report bugs and feature requests via GitHub Issues
- Documentation: Check the main package README for detailed documentation
- Community: Join the discussion in Umbraco Community
Note: This is a core infrastructure package designed to be consumed by the main Our.Umbraco.Lockdown
package. For end-user functionality, please install the main package instead.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Umbraco.Cms.Core (>= 13.8.1)
- Umbraco.Cms.Web.BackOffice (>= 13.8.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Our.Umbraco.Lockdown.Core:
Package | Downloads |
---|---|
Our.Umbraco.Lockdown
A comprehensive content lockdown plugin for Umbraco CMS that provides role-based publishing controls and security enforcement during maintenance periods. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0-beta.1 | 221 | 8/12/2025 |