1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fix permission evaluation for BulkComponentCreateViews

This commit is contained in:
Jeremy Stretch
2020-06-17 13:30:00 -04:00
parent 3890d17c61
commit 360c56ec34

View File

@ -1162,6 +1162,9 @@ class BulkComponentCreateView(GetReturnURLMixin, ObjectPermissionRequiredMixin,
table = None
template_name = 'utilities/obj_bulk_add_component.html'
def get_required_permission(self):
return f'dcim.add_{self.queryset.model._meta.model_name}'
def post(self, request):
logger = logging.getLogger('netbox.views.BulkComponentCreateView')
parent_model_name = self.parent_model._meta.verbose_name_plural