I have 3 roles: superuser, poweruser and user. I have table "data" and functions data_select and data_insert.
Now I would like to define, that only superuser can access table "data". Poweruser and user can not access table "data" directly, but only through the functions.
User can run only function data_select, poweruser can run both data_select and data_insert.
So then I can create users alice, bob, ... and inherits them privileges of user or poweuser.
Is this actually achievable? I am fighting with this for the second day and not getting anywhere.
Thank you for your time.