Skip to content

If you create objects (cables, devices, IPs, almost everything...) without specifying a tenant while you have no rights to create them without a tenant, they are still created as “zombies” and cannot be deleted. #19585

Closed as not planned
@jr3001

Description

@jr3001

Deployment Type

Self-hosted

NetBox Version

v4.2.7

Python Version

3.10

Steps to Reproduce

  1. Create a user of type "Employee"
  2. Create a Tenant and name it what you want, copy the tenant_id out of the url.
  3. Give the user OR group only Tenant specific rights to e.g. create a Device
    1. to do this you go as admin to "Admin" -> "Permissions" create a new permission, allow actions "Can view", "Can add", "Can change" & "Can delete" and then assign permissions:
      • DCIM > Device
    2. you assign the permission to the user.
    3. at the end you paste the following under "Restrictions" of the Permission and replace the tenant_id with the tenant you created bevore.
      {"tenant__id": 22}
      it can look like that:
      Image
    4. to make the user able to see Device-types and roles and stuff you create a second permission non-tenant specific, to do this start the creation process allow action "Can view" only and select the following permissions after assigning the permission to the User:
      • DCIM > Devicerole
      • DCIM > Devicetype
      • DCIM > Location

it can look like that:
Image

  1. Try to create a Device using NO TENANT with the Test User.
    • you will get error: Operation failed due to object-level permissions violation

Image
Image

  1. Login as Admin
  2. Search for the Device name or similar, you will find the device.
  3. Try to edit the Zombie, you will get an error but it will apply the change.```<class 'dcim.models.devices.Device.DoesNotExist'>evice matching query does not exist.

Python-Version: 3.11.2
NetBox-Version: 4.2.7
Plugins:
netbox_branching: 0.5.4
netbox_documents: 0.7.2
netbox_interface_synchronization: 4.1.6
netbox_inventory: 2.3.0
netbox_ipcalculator: 1.4.9
netbox_topology_views: 4.2.1

7. Try to delete the device, its impossible due to:

<class 'dcim.models.devices.Device.DoesNotExist'>

Device matching query does not exist.

Python-Version: 3.11.2
NetBox-Version: 4.2.7
Plugins:
netbox_branching: 0.5.4
netbox_documents: 0.7.2
netbox_interface_synchronization: 4.1.6
netbox_inventory: 2.3.0
netbox_ipcalculator: 1.4.9
netbox_topology_views: 4.2.1


### Expected Behavior

Device is not going to be created due to permissions.

### Observed Behavior

User got error `Operation failed due to object-level permissions violation` but a zombie/broken device got created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions