mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #10719: Prevent user without sufficient permission from creating an IP address via FHRP group creation
This commit is contained in:
@@ -930,6 +930,12 @@ class FHRPGroupEditView(generic.ObjectEditView):
|
||||
|
||||
return return_url
|
||||
|
||||
def alter_object(self, obj, request, url_args, url_kwargs):
|
||||
# Workaround to solve #10719. Capture the current user on the FHRPGroup instance so that
|
||||
# we can evaluate permissions during the creation of a new IPAddress within the form.
|
||||
obj._user = request.user
|
||||
return obj
|
||||
|
||||
|
||||
class FHRPGroupDeleteView(generic.ObjectDeleteView):
|
||||
queryset = FHRPGroup.objects.all()
|
||||
|
Reference in New Issue
Block a user