Skip to main content
Version: 1.28 (Current)

Delete Role

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, Conditions

Deletes a security role from the current portal. You find the role by name or ID. Users who had the role lose it.

caution

Deleting a role can't be undone. Users lose the role and the access it gave them. The action doesn't protect system roles, so it can also delete Administrators or Registered Users, which breaks the portal.

For how roles are used in Plant an App, see Roles.

Typical Use Cases​

  • Remove a customer's role when their account is closed
  • Clean up roles created with Create Role for test data or temporary projects

Don't use it to​

  • Take a role away from one user. Use Revoke User Role instead.
  • Stop a role from working for a while. Set its status to Disabled with Update Role instead.
Action NameDescription
Create RoleCreates a role.
Update RoleChanges a role, for example to disable it.
Revoke User RoleRemoves a user from a role.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Role IdentifierThe role to delete, as a role name (for example Customer - Contoso) or a role ID (for example 42). A number is always treated as an ID. The role must be in the current portal.Yesempty stringYes

Output Parameters Reference​

This action doesn't produce any output tokens.

Considerations​

  • There's no permission check in the action. Anyone who can run it can delete any role in the portal. Only put it where administrators or other trusted users can reach it.
  • System roles aren't protected. The action deletes Administrators, Registered Users or any other role you give it. Add a condition that blocks them, as in the example below.
  • Users in the role lose it. The action doesn't ask for confirmation or check how many users have the role. The role is deleted with DNN's own role deletion.
  • Numeric role names can't be found by name. A value like 2024 is treated as a role ID. If another role has that ID, that role is deleted instead.
  • Errors. If Role Identifier is empty or the role isn't found, the action fails with Delete Role : No value provided for the role identifier! or Delete Role : No role was found with the Role Identifier (...)!. Administrators see these messages. Other users see a general error message.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Delete a customer role, but never a system role​

This action deletes the role named in [RoleName]. The condition skips the Administrators and Registered Users roles.

{
"Title": "Delete Role",
"ActionType": "DeleteRole",
"Description": "Delete the customer's role",
"Condition": "[RoleName] != \"Administrators\" && [RoleName] != \"Registered Users\"",
"Parameters": {
"RoleIdentifier": "[RoleName]"
}
}

Revised 09/27/2026