daichirata / hammer

🛠 hammer is a command-line tool to schema management for Google Cloud Spanner.
MIT License
83 stars 24 forks source link

Add support for roles #64

Open rail44 opened 2 months ago

rail44 commented 2 months ago

I added support for creating roles and granting permissions to them, which is used in Spanner's Fine Grained Access Control.

https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#role_statements https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#grant_and_revoke_statements

Unlike tables, etc., these do not retain data internally, so as a diff, simply do a drop/revoke and then create/grant. I'd be happy to learn of any errors in implementation policy, missing test cases, etc.