michael-s-molina commented on code in PR #24630:
URL: https://github.com/apache/superset/pull/24630#discussion_r1258742504


##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -125,7 +125,9 @@ class SaveModal extends React.Component<SaveModalProps, 
SaveModalState> {
     if (dashboardId) {
       try {
         const result = await this.loadDashboard(dashboardId);
-        if (result) {
+        if (
+          result?.owners.some((owner: any) => owner.id === this.props.userId)

Review Comment:
   @jfrag1 You're right. Unfortunately the single version does not support 
filters 🤦🏼‍♂️  
   
   Maybe we could use the `/api/v1/dashboard` like this:
   
   ```
   {
     "columns": [
       "id",
       "dashboard_title"
     ],
     "filters": [
       {
         "col": "id",
         "opr": "eq",
         "value": <dashboardId>
       },
       {
         "col": "owners",
         "opr": "rel_m_m",
         "value": <userId>
       }
     ]
   }
   ```



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -125,7 +125,9 @@ class SaveModal extends React.Component<SaveModalProps, 
SaveModalState> {
     if (dashboardId) {
       try {
         const result = await this.loadDashboard(dashboardId);
-        if (result) {
+        if (
+          result?.owners.some((owner: any) => owner.id === this.props.userId)

Review Comment:
   @jfrag1 You're right. Unfortunately the single version does not support 
filters 🤦🏼‍♂️  
   
   Maybe we could use the `/api/v1/dashboard` like this:
   
   ```
   {
     "columns": [
       "id",
       "dashboard_title"
     ],
     "filters": [
       {
         "col": "id",
         "opr": "eq",
         "value": <dashboardId>
       },
       {
         "col": "owners",
         "opr": "rel_m_m",
         "value": <userId>
       }
     ]
   }
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to