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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Our.Umbraco.NodeDefender" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Our.Umbraco.NodeDefender --version 3.0.1
#r "nuget: Our.Umbraco.NodeDefender, 3.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.1 351 1/17/2023
3.0.0 279 1/17/2023
2.0.0 600 6/20/2022
1.1.0 493 5/31/2022
1.0.0 549 5/31/2022