Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support GRANT .. ON SCHEMA .. in Babelfish (babelfish-for-postgresql#…
…1848) 1. Supported syntax GRANT <permission> ON SCHEMA::<schema_name> TO <user_name> 2. Supported syntax REVOKE <permission> ON SCHEMA::<schema_name> FROM <user_name> 3. Added one SQL statement PLTSQL_STMT_GRANTSCHEMA to store relevant information to execute GRANT/REVOKE .. ON SCHEMA .. statements. 4. Created one catalog table sys.babelfish_schema_permissions to hold the details about schema name, database name, object name, permission name and user name for each GRANT/REVOKE statements. 5. GRANT on schema/objects adds a row in the catalog table if not exists already. 6. REVOKE on schema/objects removes the corresponding row in the catalog table if it exists already. 7. REVOKE on schema internally grants permission to all the objects if there are explicit permissions granted to the objects belonging to the same schema. 8. GRANT ALL on objects work as it is and add rows in the catalog for each relevant permission depending on the object type. 9. REVOKE ALL on object should do nothing, if the relevant schema permission exists in the catalog. But, it should remove the rows from the catalog if the object level permission is granted. 10. Drop statement for OBJECT/SCHEMA removes all the relevant object entries from the catalog. Task: BABEL-4344 Signed-off-by: Shalini Lohia <[email protected]> Co-authored-by: Shalini Lohia <[email protected]>
- Loading branch information