villebro 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_r362591000
##########
File path: superset/views/dashboard/api.py
##########
@@ -258,60 +336,43 @@ def post(self):
except SQLAlchemyError as e:
return self.response_422(message=str(e))
- @expose("/<pk>", methods=["PUT"])
+ @expose("/<model_id>", methods=["DELETE"])
@protect()
+ @check_owner
@safe
- def put(self, pk):
- """Changes a dashboard
+ def delete(self, item): # pylint: disable=arguments-differ
+ """Delete Dashboard
---
- put:
+ delete:
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
+ description: Dashboard delete
content:
application/json:
schema:
type: object
properties:
- result:
- $ref:
'#/components/schemas/{{self.__class__.__name__}}.put'
- 400:
- $ref: '#/components/responses/400'
+ message:
+ type: string
401:
$ref: '#/components/responses/401'
+ 403:
+ $ref: '#/components/responses/401'
Review comment:
should probably be `'#/components/responses/403'`
----------------------------------------------------------------
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]