fix: shorten email permission codenames to fit NetBox action limit
NetBox ObjectPermission actions are limited to 30 characters, so assigning manage_softwarelicense_email_notifications or manage_certificate_email_notifications to a group failed validation. Rename them to manage_license_emails and manage_certificate_emails and migrate existing auth permissions in place to keep assignments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
5dedfc9206
commit
30d748969f
6 files changed
+56
-8
No files matched your search
@@ -66,7 +66,7 @@ class SoftwareLicenseSerializer(NetBoxModelSerializer):
|
||||
if (
|
||||
"email_notifications" in attrs
|
||||
and request is not None
|
||||
and not request.user.has_perm("netbox_slm.manage_softwarelicense_email_notifications")
|
||||
and not request.user.has_perm("netbox_slm.manage_license_emails")
|
||||
):
|
||||
raise serializers.ValidationError(
|
||||
{"email_notifications": _("You do not have permission to change email notifications.")}
|
||||
@@ -248,7 +248,7 @@ class CertificateSerializer(NetBoxModelSerializer):
|
||||
if (
|
||||
"email_notifications" in attrs
|
||||
and request is not None
|
||||
and not request.user.has_perm("netbox_slm.manage_certificate_email_notifications")
|
||||
and not request.user.has_perm("netbox_slm.manage_certificate_emails")
|
||||
):
|
||||
raise serializers.ValidationError(
|
||||
{"email_notifications": _("You do not have permission to change email notifications.")}
|
||||
|
||||
Reference in new issue
Block a user