Protected items
Protect the dashboards, rule chains, profiles and other items a solution depends on so that nobody can delete them.
A protected (permanent) item can be opened and edited as usual, but nobody can delete it: not a tenant administrator, not a customer user, not an API client. A delete is refused with HTTP 403 and the message "This item is protected and cannot be deleted." The UI hides the delete actions of protected items and shows a lock icon.
Use it for the parts of a solution that the rest depends on: the imported dashboards, rule chains, device and asset profiles, notification rules and templates, widget bundles, and the customer accounts of the site.
What can be protected
| Type | API name |
|---|---|
| Dashboards | DASHBOARD |
| Rule chains | RULE_CHAIN |
| Device profiles | DEVICE_PROFILE |
| Asset profiles | ASSET_PROFILE |
| Notification rules | NOTIFICATION_RULE |
| Notification templates | NOTIFICATION_TEMPLATE |
| Widget bundles | WIDGETS_BUNDLE |
| Customers | CUSTOMER |
| Assets | ASSET |
| Devices | DEVICE |
The list is kept per tenant (admin setting nexusProtected, no schema change).
Who can do what
| Action | Who |
|---|---|
| See which items are protected | Every signed-in user of the tenant |
| Protect items | Tenant administrator, or the system administrator for a tenant |
| Remove the protection | System administrator only |
API
# The protected items of your tenant: one array of ids per type
curl -H "X-Authorization: Bearer $TOKEN" http://localhost:8080/api/nexus/protected
# Protect items (tenant administrator; idempotent, at most 1000 ids per call)
curl -X POST -H "X-Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"entityType":"DASHBOARD","ids":["<dashboard id>"]}' \
http://localhost:8080/api/nexus/protected
# The system administrator protects items of a tenant
curl -X POST -H "X-Authorization: Bearer $SYSADMIN_TOKEN" -H "Content-Type: application/json" \
-d '{"entityType":"CUSTOMER","ids":["<customer id>"]}' \
"http://localhost:8080/api/nexus/protected?tenantId=<tenant id>"
# Remove the protection again (system administrator only, tenantId required)
curl -X DELETE -H "X-Authorization: Bearer $SYSADMIN_TOKEN" \
"http://localhost:8080/api/nexus/protected/DASHBOARD/<dashboard id>?tenantId=<tenant id>"
Every id must be an existing item of the tenant. On a cluster, a change reaches the other nodes within 30 seconds (nexus.protected.cache_ttl_sec).
Limits
- Deleting the whole tenant (system administrator) still removes everything, protected items included.
- Unassigning a protected dashboard or device from a customer is allowed; only the delete is blocked.