goldjee opened a new pull request, #37932:
URL: https://github.com/apache/superset/pull/37932

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   Imagine a user who doesn't have "all database access" or "all datasource 
access" permissions, but has access to a certain set of database connections 
and can create/edit datasources pointing to them. Current implementation does 
not allow such users to duplicate their datasets, displaying vague 500 error.
   
   This PR fixes duplication checks that are present in 
`superset/commands/dataset/duplicate.py` and allows users to create copies of 
their datasets.
   
   ### TESTING INSTRUCTIONS
   Assuming that the test would be carried out on an installation of Superset 
with stock example (meta)data,
   
   1. Create a copy of Alpha role and remove "all database access" and "all 
datasource access" permissions from it. Add "database access [examples]" 
permission to this role.
   2. Create a new user and assign this role and "sql_lab" to it.
   3. Log into Superset as this user and verify it has access to example 
datasets.
   4. Create a new virtual dataset with some query (`select 1 as c`, for 
example).
   5. On "Datasets" page, find your newly created dataset and hit "Duplicate" 
button.
   6. Fill in a new unique name for the copy and hit "Duplicate" button.
   
   Superset should create a copy of your test dataset with a new name, 
displaying no errors.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes 
[#27712](https://github.com/apache/superset/issues/27712)
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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