ContentType Permission Needed for API Users #4622

Closed
opened 2025-12-29 18:38:22 +01:00 by adam · 3 comments
Owner

Originally created by @kvedder-amplex on GitHub (Mar 3, 2021).

Version

Netbox V2.10.5

Expected Behavior

When calling ctype = ContentType.objects.get(id=instance.assigned_object_type_id) in a plugin that is triggered by the API, it should return the requested data.

Observed Behavior

  • When querying the ContentType, I get a 403 Denied.
  • From what I can tell the user assigned to the API Key does not have permissions to access the ContentType model. Even if the user was a SuperAdmin.
  • I checked my permissions list and did have a user that could access the ContentType model.
    image
  • When I switched the API User mapping to that user, the plugin performed as expected
  • I would like to be able to assign other users to be able to access the ContentType Model, and have SuperUsers be able to access it from within the plugin.
  • When I go into the Permissions to Add another user to that permission, the ContentType model is not available in the Models List.
    image
Originally created by @kvedder-amplex on GitHub (Mar 3, 2021). ### Version Netbox V2.10.5 ### **Expected Behavior** When calling `ctype = ContentType.objects.get(id=instance.assigned_object_type_id)` in a plugin that is triggered by the API, it should return the requested data. ### **Observed Behavior** - When querying the ContentType, I get a 403 Denied. - From what I can tell the user assigned to the API Key does not have permissions to access the ContentType model. Even if the user was a SuperAdmin. - I checked my permissions list and did have a user that could access the ContentType model. ![image](https://user-images.githubusercontent.com/44881775/109877650-4955a480-7c41-11eb-9d78-d613bf9d175e.png) - When I switched the API User mapping to that user, the plugin performed as expected - I would like to be able to assign other users to be able to access the ContentType Model, and have SuperUsers be able to access it from within the plugin. - When I go into the Permissions to Add another user to that permission, the ContentType model is not available in the Models List. ![image](https://user-images.githubusercontent.com/44881775/109877919-989bd500-7c41-11eb-84bc-003d09a6e818.png)
adam closed this issue 2025-12-29 18:38:22 +01:00
Author
Owner

@DanSheps commented on GitHub (Mar 4, 2021):

I don't believe we are restricting the ContentType query as this is a builtin DJango model but perhaps @jeremystretch can confirm.

@DanSheps commented on GitHub (Mar 4, 2021): I don't believe we are restricting the ContentType query as this is a builtin DJango model but perhaps @jeremystretch can confirm.
Author
Owner

@jeremystretch commented on GitHub (Mar 8, 2021):

This issue is pending closure as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

@jeremystretch commented on GitHub (Mar 8, 2021): This issue is pending closure as it does not conform to one of the [provided templates](https://github.com/netbox-community/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/netbox-community/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Author
Owner

@jeremystretch commented on GitHub (Mar 17, 2021):

Closing this as no further information has been provided, but it's evident from your problem description that you're looking for assistance with the development of a plugin. Please consider creating a discussion instead.

@jeremystretch commented on GitHub (Mar 17, 2021): Closing this as no further information has been provided, but it's evident from your problem description that you're looking for assistance with the development of a plugin. Please consider creating a [discussion](https://github.com/netbox-community/netbox/discussions/new) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4622