craig-rueda 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_r362571534
 
 

 ##########
 File path: superset/views/dashboard/api.py
 ##########
 @@ -26,13 +27,32 @@
 
 import superset.models.core as models
 from superset import appbuilder
-from superset.exceptions import SupersetException
+from superset.exceptions import SupersetException, SupersetSecurityException
 from superset.utils import core as utils
 from superset.views.base import BaseSupersetModelRestApi, BaseSupersetSchema
 
+from ..base import check_ownership
 from .mixin import DashboardMixin
 
 
+def check_owner(f):
 
 Review comment:
   Since this is doing a bit more than just "checking owner" (checks for 
existence of instances), I think you should name it something like 
`api_security_wrapper`. We could potentially reuse this in other APIs as well. 
Otherwise, LGTM.

----------------------------------------------------------------
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