graphql-engine
graphql-engine copied to clipboard
Dropping inconsistent permissions due to missing columns deletes entire permissions
Version Information
Server Version: 2.6.0
Environment
OSS
What is the expected behaviour?
When metadata is inconsistent due to missing column, dropping this metadata should only drop the references to the missing columns, not the whole permission metadata.
Keywords
Permissions, metadata, inconsistency, console
What is the current behaviour?
When metadata is inconsistent due to missing columns being referenced in permissions, deleting inconsistent objects should only delete the references to these columns, not the entire permissions.
How to reproduce the issue?
- Create and track the following table
CREATE TABLE test (id INT, name TEXT);
-
Add select permissions for this table. Make sure both columns
id
andname
are allowed for select. -
Using a third party sql client (not hasura, since it won't allow inconsistencies), run this sql
ALTER TABLE test DROP COLUMN name;
- Reload metadata from the console. Metadata will now be inconsistent, due to the
name
column now being missing - Choose to "delete all" inconsistent objects
- Permissions are deleted, instead of removing the reference to the
name
column
Hasura should instead only remove the name
column from select permissions.
horrible bug! please fix!