xavier-GitHub76 commented on issue #33272:
URL: https://github.com/apache/superset/issues/33272#issuecomment-4716164015
Here are a few elements to help with the implementation
List of permissions in version 6.1.0-RC3 :
```sql
SELECT name FROM public.ab_permission
ORDER BY name
```
85 permissions
List of deprecated permissions on an existing migrated Superset :
```sql
SELECT name FROM public.ab_permission WHERE name NOT IN (
'all_database_access',
'all_datasource_access',
'all_query_access',
'can_activate',
'can_add',
'can_add_role_permissions',
'can_bulk_create',
'can_cache_dashboard_screenshot',
'can_csv',
'can_dashboard',
'can_dashboard_permalink',
'can_delete',
'can_delete_embedded',
'can_delete_query',
'can_download',
'can_drill',
'can_duplicate',
'can_edit',
'can_estimate_query_cost',
'can_execute_sql_query',
'can_expanded',
'can_explore',
'can_explore_json',
'can_export',
'can_export_as_example',
'can_export_csv',
'can_export_streaming_csv',
'can_external_metadata',
'can_external_metadata_by_name',
'can_fetch_datasource_metadata',
'can_file_handler',
'can_format_sql',
'can_get',
'can_get_column_values',
'can_get_drill_info',
'can_get_embedded',
'can_get_or_create_dataset',
'can_get_results',
'can_grant_guest_token',
'can_import_',
'can_info',
'can_invalidate',
'can_language_pack',
'can_list',
'can_list_role_permissions',
'can_list_roles',
'can_log',
'can_migrate_query',
'can_post',
'can_put',
'can_put_chart_customizations',
'can_query',
'can_query_form_data',
'can_read',
'can_recent_activity',
'can_samples',
'can_save',
'can_set_embedded',
'can_share_chart',
'can_share_dashboard',
'can_show',
'can_slice',
'can_sqllab',
'can_sqllab_history',
'can_tag',
'can_tags',
'can_this_form_get',
'can_this_form_post',
'can_time_range',
'can_update_role_groups',
'can_update_role_users',
'can_upload',
'can_userinfo',
'can_validate_expression',
'can_view_chart_as_table',
'can_view_query',
'can_warm_up_cache',
'can_write',
'catalog_access',
'copyrole',
'database_access',
'datasource_access',
'menu_access',
'schema_access',
'userinfoedit'
)
ORDER BY name
```
-- ============================================================
-- Step 1 : Delete from ab_permission_view_role
-- ============================================================
DELETE FROM ab_permission_view_role
WHERE permission_view_id IN (
SELECT pv.id
FROM ab_permission_view pv
INNER JOIN ab_permission p ON pv.permission_id = p.id
WHERE p.name IN (
'can_select_star'
-- all deprecated permissions
)
);
-- ============================================================
-- Step 2 : Delete from ab_permission_view
-- ============================================================
DELETE FROM ab_permission_view
WHERE permission_id IN (
SELECT id
FROM ab_permission
WHERE name IN (
'can_select_star'
-- all deprecated permissions
)
);
-- ============================================================
-- Step 3 : Delete from ab_permission
-- ============================================================
DELETE FROM ab_permission
WHERE name IN (
'can_select_star'
-- all deprecated permissions
);
-- ============================================================
-- Check
-- ============================================================
SELECT COUNT(*) AS remaining FROM ab_permission
WHERE name IN (
'can_select_star'
-- all deprecated permissions
);
-- if COUNT = 0 → COMMIT, else → ROLLBACK
> ab_view_menu is not handled in this deletion process. You should check
that the menu is no longer used by any permissions.
--
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]