[PR #17268] [MERGED] Fixes: #16973 - Resolve $user token to User.id for use in permissions based on custom fields #15039

Closed
opened 2025-12-30 00:19:36 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17268
Author: @bctiemann
Created: 8/26/2024
Status: Merged
Merged: 8/26/2024
Merged by: @jeremystretch

Base: developHead: 16973-custom-field-resolve-$user


📝 Commits (3)

  • 05bcfd7 Resolve $user token to User.id for use in permissions based on custom fields
  • 8f5162e Cleaner type check
  • 5e6aab3 Simplify User object check by updating tokens instead of resolved values

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 netbox/utilities/permissions.py (+8 -0)

📄 Description

Fixes: #16973 - Resolve $user token to User.id for use in permissions based on custom fields

Adds special handling for CONSTRAINT_TOKEN_USER ("$user" token) when used in custom fields in object-based permissions.


🔄 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/17268 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 8/26/2024 **Status:** ✅ Merged **Merged:** 8/26/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `16973-custom-field-resolve-$user` --- ### 📝 Commits (3) - [`05bcfd7`](https://github.com/netbox-community/netbox/commit/05bcfd77222e5848962e5215ab30573bbfe2dd1f) Resolve $user token to User.id for use in permissions based on custom fields - [`8f5162e`](https://github.com/netbox-community/netbox/commit/8f5162ed023d1c22f8b2d257d73db93a4e00a676) Cleaner type check - [`5e6aab3`](https://github.com/netbox-community/netbox/commit/5e6aab33a6b7dd22471cdb7d3bd7f64b9b571a33) Simplify User object check by updating tokens instead of resolved values ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/permissions.py` (+8 -0) </details> ### 📄 Description ### Fixes: #16973 - Resolve $user token to User.id for use in permissions based on custom fields Adds special handling for `CONSTRAINT_TOKEN_USER` ("$user" token) when used in custom fields in object-based permissions. --- <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-30 00:19:36 +01:00
adam closed this issue 2025-12-30 00:19:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15039