fnardin-maystreet opened a new issue, #32981:
URL: https://github.com/apache/superset/issues/32981

   ### Bug description
   
   The issue: 
   - DatasetList component only checks for the `can_write` permission when 
showing the delete button (link to code: 
https://github.com/apache/superset/blob/master/superset-frontend/src/pages/DatasetList/index.tsx#L417)
   - `DeleteDatasetCommand` executes 
`security_manager.raise_for_ownership(model)` and fails
   - UI shows the `There was an issue deleting <dataset name>: Forbidden` error
   
   Expected behavior:
   - The delete button is disabled if the user is not the dataset owner, 
similarly to the edit button
   
   Proposed solution: use the `allowEdit` variable to disable the button
   ```ts
   {canDelete && (
     <Tooltip
       id="delete-action-tooltip"
       title={
         allowEdit
           ? t('Delete')
           : t(
               'You must be a dataset owner in order to delete. Please reach 
out to a dataset owner to request modifications or edit access.',
             )
       }
       placement="bottom"
     >
       <span
         role="button"
         tabIndex={0}
         className={allowEdit ? 'action-button' : 'disabled'}
         onClick={allowEdit ? handleDelete : undefined}
       >
         <Icons.Trash />
       </span>
     </Tooltip>
   )}
   ```
   
   ### Screenshots/recordings
   
   <img width="954" alt="Image" 
src="https://github.com/user-attachments/assets/52ac85af-b2f0-48fe-84ab-b125a12f25d7";
 />
   <img width="926" alt="Image" 
src="https://github.com/user-attachments/assets/ec671039-35bc-457b-ae15-7c3f380a43e7";
 />
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   Not applicable
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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