dpgaspar commented on a change in pull request #8911: [WiP] [dashboard] Fix, 
prevent delete and update on dashes not owned
URL: 
https://github.com/apache/incubator-superset/pull/8911#discussion_r362594917
 
 

 ##########
 File path: superset/views/dashboard/api.py
 ##########
 @@ -207,6 +229,62 @@ class DashboardRestApi(DashboardMixin, 
BaseSupersetModelRestApi):
     }
     filter_rel_fields_field = {"owners": "first_name", "slices": "slice_name"}
 
+    @expose("/<model_id>", methods=["PUT"])
+    @protect()
+    @check_owner
+    @safe
+    def put(self, item):  # pylint: disable=arguments-differ
+        """Changes a dashboard
+        ---
+        put:
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            name: pk
+          requestBody:
+            description: Model schema
+            required: true
+            content:
+              application/json:
+                schema:
+                  $ref: '#/components/schemas/{{self.__class__.__name__}}.put'
+          responses:
+            200:
+              description: Item changed
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      result:
+                        $ref: 
'#/components/schemas/{{self.__class__.__name__}}.put'
+            400:
+              $ref: '#/components/responses/400'
+            401:
+              $ref: '#/components/responses/401'
+            403:
+              $ref: '#/components/responses/401'
 
 Review comment:
   I Know... 403 is not implemented on FAB, and the `responses` OpenAPI 
override forces (for now) a full override of the responses. I'll improve this 
on FAB and get back to this with a proper solution. I would say it's not a 
blocking issue

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to