Our.Umbraco.NodeDefender
3.0.1
dotnet add package Our.Umbraco.NodeDefender --version 3.0.1
NuGet\Install-Package Our.Umbraco.NodeDefender -Version 3.0.1
<PackageReference Include="Our.Umbraco.NodeDefender" Version="3.0.1" />
paket add Our.Umbraco.NodeDefender --version 3.0.1
#r "nuget: Our.Umbraco.NodeDefender, 3.0.1"
// Install Our.Umbraco.NodeDefender as a Cake Addin #addin nuget:?package=Our.Umbraco.NodeDefender&version=3.0.1 // Install Our.Umbraco.NodeDefender as a Cake Tool #tool nuget:?package=Our.Umbraco.NodeDefender&version=3.0.1
Our.Umbraco.NodeDefender
A no-nonsense approach to defending nodes. I often find myself writing the same thing in a lot of projects to prevent editors from renaming a settings node, or moving it to the recycle bin. This package aims to solve that simply.
The package has no dependencies as is configured in appsettings.json
thus making it only usable on Umbraco 9+
Features
- Prevent the duplication of nodes
- Prevent the renaming of nodes
- Prevent the deletion of nodes
Installation
Usage
To setup the NodeDefender, simply add a section to your appsettings.json
called NodeDefender
.
"NodeDefender": {
"AllowedUserGroups": [],
"DenyRename": {},
"DenyDuplicate": {},
"DenyDelete": {}
}
AllowedUserGroups
These are string aliases to the user groups of the users who are immune to the defender, remember, with great power comes great responsibility.
DenyOptions
DenyRename, DenyDuplicate and DenyDelete all share the same structure
{
// an array of document string aliases
"DoctypeAliases": [
"homePage"
],
// an array of specific node Ids
"NodeIds": [
1234
],
// an array of specific node keys (as string)
"NodeKeys: [
"093b6805-db05-4510-96ac-e5ee8357d5e8"
],
// an array of composition aliases
"CompositionAliases": [
"myAwesomeComposition"
],
// The error message to send
"Message": {
"Category": "Error",
"Message": "You are not allowed to rename this node.",
"Type": "Error" // Must be 'Error', 'Info', 'Warning' or 'Success'
}
}
Full Example
"NodeDefender": {
"AllowedUserGroups": [
"defenderImmune"
],
"DenyRename": {
"DoctypeAliases": [
"homePage"
],
"NodeIds": [
1234
],
"NodeKeys: [
"093b6805-db05-4510-96ac-e5ee8357d5e8"
],
"CompositionAliases": [
"myAwesomeComposition"
],
"Message": {
"Category": "Error",
"Message": "You are not allowed to rename this node.",
"Type": "Error"
}
},
"DenyDuplicate": {
"DoctypeAliases": [
"homePage"
],
"NodeIds": [
1234
]
},
"DenyDelete": {
"DoctypeAliases": [
"homePage"
],
"NodeIds": [
1234
]
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- Umbraco.Cms.Web.BackOffice (>= 10.0.0)
- Umbraco.Cms.Web.Website (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.