apache / apache/superset

Deprecated permissions are not deleted after upgrade

Open
#33,272 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
74.8k
Forks
18.3k
Avg merge
2d 4h
Merged PRs (30d)
664

Description

### Bug description

I reopen an issue about deprecated permissions not deleted after upgrade
(previous issue : https://github.com/apache/superset/issues/29504)

Hello
after upgrade, deprecated permissions are not deleted.

I use a docker container.
At every step, I do :
- Run a container, with persistant volume for the database (/app/superset_home) and config (/app/pythonpath)
- Execute 'superset db upgrade'
- Execute 'superset init'

I tried a migration from 1.5.2 to 5.0.0-RC2 directly or by steps (1.5.2 --> 2.0.0 --> 3.0.0 --> 4.0.2 --> 5.0.0-rc2)
For the example, we focus on 'can select star on Superset'

| Version | Permissions count | 'can select star on Superset' |
| --- | --- | --- |
| 1.5.2 | 249 | Present |
| 2.0.0 | 194 | Not present |
| 3.0.0 | 169 | Not present |
| 4.0.2 | 167 | Not present |
| 5.0.0-RC2 | 160 | Not present |

With direct or steps migration, permission count is always increase

| Version | Permissions count | 'can select star on Superset' |
| --- | --- | --- |
| 1.5.2 | 249 | Present |
| ↳ 2.0.0 | 251 | Present |
| ↳ 3.0.0 | 276 | Present |
| ↳ 4.0.2 | 282 | Present |
| ↳ 5.0.0-RC2 | 291 | Present |

| Version | Permissions count | 'can select star on Superset' |
| --- | --- | --- |
| 1.5.2 | 249 | Present |
| ↳ 5.0.0-RC2 | 286 | Present |

In #29504, permissions_cleanup.py is mentionned by dosu but this script is not present in docker container
How can I clean deprecated permissions for my container ?

Best regards

### Screenshots/recordings

_No response_

### Superset version

master / latest-dev

### Python version

3.9

### Node version

16

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

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the upgrade with `superset db upgrade` followed by `superset init`, then read the referenced `permissions_cleanup.py` discussion and the migration entry points involved. Done means deprecated permissions such as `can select star on Superset` are removed after the upgrade without increasing permission counts unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
authorization, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.