Physicalpixel commented on issue #24399: URL: https://github.com/apache/superset/issues/24399#issuecomment-2108701423
> As a workaround you can create a database trigger which will automatically give all admins ownership of newly created charts: > > ``` > CREATE TRIGGER add_admin_role AFTER INSERT ON slices > FOR EACH ROW > INSERT INTO slice_user(user_id, slice_id) > SELECT user_id, NEW.id FROM ab_user_role > WHERE role_id=(SELECT id FROM ab_role WHERE name='Admin') AND > user_id != NEW.created_by_fk; > ``` > > And you can give admins ownership of existing charts by running this query for each admin user id (replacing <user_id> with the user_id): > > ``` > INSERT INTO slice_user (user_id, slice_id) > SELECT distinct <user_id>, slice_id FROM slice_user > WHERE slice_id NOT IN > (SELECT slice_id FROM slice_user WHERE user_id=<user_id>) > AND slice_id IN (SELECT id FROM slices); > ``` > > Hope this helps. Hi, I am importing a csv and facing this issue, where exactly do I create a scheme like this? Any help you can provide will be much appreciated. -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org