Kaynağa Gözat

Remove the DEFAULT_ACTION_PERMISSIONS constant (closes #21886)

Removes the deprecated _DEFAULT_ACTION_PERMISSIONS dict and its
__getattr__ compatibility shim from netbox/constants.py. Action
permissions should be defined via ObjectAction subclasses.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Jeremy Stretch 2 hafta önce
ebeveyn
işleme
9275db607e
2 değiştirilmiş dosya ile 13 ekleme ve 24 silme
  1. 13 0
      docs/release-notes/version-4.7.md
  2. 0 24
      netbox/netbox/constants.py

+ 13 - 0
docs/release-notes/version-4.7.md

@@ -0,0 +1,13 @@
+# NetBox v4.7
+
+## v4.7.0 (FUTURE)
+
+### Breaking Changes
+
+### Enhancements
+
+### Other Changes
+
+* [#21886](https://github.com/netbox-community/netbox/issues/21886) - Remove the obsolete `DEFAULT_ACTION_PERMISSIONS` constant
+
+### REST API Changes

+ 0 - 24
netbox/netbox/constants.py

@@ -44,30 +44,6 @@ ADVISORY_LOCK_KEYS = {
     'job-schedules': 110100,
     'job-schedules': 110100,
 }
 }
 
 
-# TODO: Remove in NetBox v4.7
-# Legacy default view action permission mapping
-_DEFAULT_ACTION_PERMISSIONS = {
-    'add': {'add'},
-    'export': {'view'},
-    'bulk_import': {'add'},
-    'bulk_edit': {'change'},
-    'bulk_delete': {'delete'},
-}
-
-
-def __getattr__(name):
-    if name == 'DEFAULT_ACTION_PERMISSIONS':
-        import warnings
-        warnings.warn(
-            f"{name} is deprecated and will be removed in NetBox v4.7. "
-            "Define action permissions via ObjectAction subclasses instead.",
-            DeprecationWarning,
-            stacklevel=2,
-        )
-        return _DEFAULT_ACTION_PERMISSIONS
-    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
-
-
 # General-purpose tokens
 # General-purpose tokens
 CENSOR_TOKEN = '********'
 CENSOR_TOKEN = '********'
 CENSOR_TOKEN_CHANGED = '***CHANGED***'
 CENSOR_TOKEN_CHANGED = '***CHANGED***'