[PR #12192] [MERGED] Closes #12207: Establish a permission for creating API tokens on behalf of other users #13921

Closed
opened 2025-12-29 23:21:33 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/12192
Author: @arthanson
Created: 4/6/2023
Status: Merged
Merged: 4/12/2023
Merged by: @jeremystretch

Base: developHead: 11091-token-permission


📝 Commits (8)

  • 72622a6 11091 add permission to allow user to create api tokens for other users
  • 51d688c 11091 update docs
  • 5af4b37 11091 fix for test
  • b8cb276 11091 fix for test
  • 989d6fd Merge branch 'develop' into 11091-token-permission
  • adda60c 11091 test case for invalid token creation
  • e91e393 11091 add test for permission grant
  • e425746 Cleanup & fix serializer validation

📊 Changes

4 files changed (+39 additions, -3 deletions)

View changed files

📝 docs/integrations/rest-api.md (+8 -3)
docs/media/admin_ui_grant_permission.png (+0 -0)
📝 netbox/users/api/serializers.py (+11 -0)
📝 netbox/users/tests/test_api.py (+20 -0)

📄 Description

Fixes: #12207

Adds a new 'grant' permission for tokens that restricts who is allowed to create tokens for other users.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/12192 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 4/6/2023 **Status:** ✅ Merged **Merged:** 4/12/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `11091-token-permission` --- ### 📝 Commits (8) - [`72622a6`](https://github.com/netbox-community/netbox/commit/72622a672d0795394ac222135f5c52bfee4080ac) 11091 add permission to allow user to create api tokens for other users - [`51d688c`](https://github.com/netbox-community/netbox/commit/51d688c0c2456f6602ca71db26c3febf5b95d1cb) 11091 update docs - [`5af4b37`](https://github.com/netbox-community/netbox/commit/5af4b374c9409e11f1944f66c5855797aa48f6e3) 11091 fix for test - [`b8cb276`](https://github.com/netbox-community/netbox/commit/b8cb27601f4b6c7b4c844ef2ea600dd0c598023d) 11091 fix for test - [`989d6fd`](https://github.com/netbox-community/netbox/commit/989d6fda64e74b18625b90f3c5650fc26ba0bf01) Merge branch 'develop' into 11091-token-permission - [`adda60c`](https://github.com/netbox-community/netbox/commit/adda60ca1619b49ffd0c543e1df8fe3fe39ddad0) 11091 test case for invalid token creation - [`e91e393`](https://github.com/netbox-community/netbox/commit/e91e3932ca4ecc892c6685b72e483e3aceb03c83) 11091 add test for permission grant - [`e425746`](https://github.com/netbox-community/netbox/commit/e425746620a02172e10c7ea7e0b3578205459fdc) Cleanup & fix serializer validation ### 📊 Changes **4 files changed** (+39 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/integrations/rest-api.md` (+8 -3) ➕ `docs/media/admin_ui_grant_permission.png` (+0 -0) 📝 `netbox/users/api/serializers.py` (+11 -0) 📝 `netbox/users/tests/test_api.py` (+20 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #12207 <!-- Please include a summary of the proposed changes below. --> Adds a new 'grant' permission for tokens that restricts who is allowed to create tokens for other users. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:21:33 +01:00
adam closed this issue 2025-12-29 23:21:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13921