[BUG] Close up create path for Green IP and Green ASN
From March 22nd, it has been possible to add Green IPs and Green ASNs through the root of the admin, by passing the approval step, even if you are not a member of staff.

This change removes the ability for user who are not members of staff.
diff --git a/apps/greencheck/admin.py b/apps/greencheck/admin.py
index c9585f7..bb9e6f6 100644
--- a/apps/greencheck/admin.py
+++ b/apps/greencheck/admin.py
@@ -441,13 +441,33 @@ class GreenASNAdmin(admin.ModelAdmin):
         "active",
         "asn",
         "hostingprovider",
+        "created",
+        "modified",
     ]
     search_fields = ["asn", "hostingprovider__name"]
-    fields = [
-        "active",
-        "asn",
-        "hostingprovider",
-    ]
+    fields = ["active", "asn", "hostingprovider", "created", "modified"]
+    readonly_fields = ["created", "modified"]
+
+    def has_view_permission(self, request, obj=None):
+        """
+        Only allow staff to view AS numbers via the main django
+        listing. We restrict this, to avoid end users seeing the list of
+        other providers in the admin.
+        """
+        if request.user.is_admin:
+            return True
+        return False
+
+    def has_add_permission(self, request):
+        """
+        We only allow staff to add AS numbers via the main django
+        listing.
+        Non-staff users need to use the hosting profile change view
+        page instead.
+        """
+        if request.user.is_admin:
+            return True
+        return False
 
     def get_queryset(self, request):
         qs = super().get_queryset(request)
@@ -473,18 +493,34 @@ class GreenIPAdmin(admin.ModelAdmin):
         "ip_start",
         "ip_end",
         "hostingprovider",
+        "created",
+        "modified",
     ]
     search_fields = [
         "hostingprovider__name",
         "ip_start",
         "ip_end",
     ]
-    fields = [
-        "active",
-        "ip_start",
-        "ip_end",
-        "hostingprovider",
-    ]
+    fields = ["active", "ip_start", "ip_end", "hostingprovider", "created", "modified"]
+    readonly_fields = ["created", "modified"]
+
+    def has_view_permission(self, request, obj=None):
+        """
+        Only allow staff to view AS numbers via the main django
+        listing. We restrict this, to avoid end users seeing the list of
+        other providers in the admin.
+        """
+        if request.user.is_admin:
+            return True
+        return False
+
+    def has_add_permission(self, request):
+        """
+        Like ASNs, only staff should be able to add IP ranges directly
+        """
+        if request.user.is_admin:
+            return True
+        return False
 
     def get_queryset(self, request):
         qs = super().get_queryset(request)
['apps/greencheck/admin.py']