Procházet zdrojové kódy

feat: add export permission (#5841)

Joe před 9 měsíci
rodič
revize
59ad091e69
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      api/controllers/console/app/app.py

+ 4 - 0
api/controllers/console/app/app.py

@@ -190,6 +190,10 @@ class AppExportApi(Resource):
     @get_app_model
     def get(self, app_model):
         """Export app"""
+        # The role of the current user in the ta table must be admin, owner, or editor
+        if not current_user.is_editor:
+            raise Forbidden()
+
         app_service = AppService()
 
         return {