vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.48k stars 2.09k forks source link

tableacl: add more nuance to permit insert/update while deying delete #4728

Open dweitzman opened 5 years ago

dweitzman commented 5 years ago

For table ACLs, delete statements are currently grouped into the WRITER role.

Some environments may find idea of mysql rows being removed by OLTP traffic or ordinary batch jobs scary, with a preference instead of having people soft-delete rows by marking them as deleted until a few days or weeks later a garbage collector job does the actual hard deleting.

Seems like delete and update share plan types and there's a map of plan types to what tableacl role they require, so I'll need to poke a little more to see what might be a good way to support this.

Longer term, it would also be awesome to support MySQL 8 roles or something like them in vitess so that people with permission to do so could selectively activate and deactivate powers like the power to delete rows within a single session as a single user.

sougou commented 5 years ago

I think we should do this as part of the v2 cleanup, which will render most of the vttablet plans obsolete. We can then introduce new ones.