You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/12/14 19:23:03 UTC

[GitHub] [superset] jfrag1 commented on a change in pull request #17449: feat: cleanup permissions when db updated/deleted

jfrag1 commented on a change in pull request #17449:
URL: https://github.com/apache/superset/pull/17449#discussion_r768975089



##########
File path: superset/databases/commands/update.py
##########
@@ -85,3 +89,21 @@ def validate(self) -> None:
             exception = DatabaseInvalidError()
             exception.add_list(exceptions)
             raise exception
+
+    @staticmethod
+    def _update_permissions(
+        database: Database, schemas: List[str], old_db_name: str
+    ) -> None:
+        if old_db_name != database.database_name:
+            security_manager.add_permission_view_menu("database_access", database.perm)
+            for dataset in database.tables:
+                security_manager.add_permission_view_menu(

Review comment:
       There are currently no tests covering these database update/delete commands - I spent about an hour looking into adding some, but I kept running into issues/couldn't figure out how to properly set everything up. I'm busy with other work and don't have time right now to prioritize adding these tests.




-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org