Delete Role
Audience:
Low-code EngineersSkill 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
Disabledwith Update Role instead.
Related Actions
| Action Name | Description |
|---|---|
| Create Role | Creates a role. |
| Update Role | Changes a role, for example to disable it. |
| Revoke User Role | Removes a user from a role. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Role Identifier | The 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. | Yes | empty string | Yes |
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 Usersor 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
2024is treated as a role ID. If another role has that ID, that role is deleted instead. - Errors. If
Role Identifieris empty or the role isn't found, the action fails withDelete Role : No value provided for the role identifier!orDelete 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