Sfoglia il codice sorgente

Grant superusers permission to decrypt all secrets

Jeremy Stretch 9 anni fa
parent
commit
edde021c85
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      netbox/secrets/models.py

+ 2 - 0
netbox/secrets/models.py

@@ -304,4 +304,6 @@ class Secret(CreatedUpdatedModel):
         """
         """
         Check whether the given user has permission to decrypt this Secret.
         Check whether the given user has permission to decrypt this Secret.
         """
         """
+        if user.is_superuser:
+            return True
         return user in self.role.users.all() or user.groups.filter(pk__in=self.role.groups.all()).exists()
         return user in self.role.users.all() or user.groups.filter(pk__in=self.role.groups.all()).exists()