How to control table ownership #18971
-
|
I ceate user like that: create database bladedb root@localhost:8000/default/default> use bladedb; use bladedb root@localhost:8000/default/bladedb> create user bladeuser identified by 'bladeuser'; create user bladeuser identified by 'bladeuser' root@localhost:8000/default/bladedb> create role bladerole; create role bladerole root@localhost:8000/default/bladedb> grant ownership on bladedb.* to role bladerole; grant ownership on bladedb.* to role bladerole grant role bladerole to bladeuser then run go scrpts so i do another grant then run succecc
This results in the need to manually modify ownership every time a table is created in the program. Is there any way to automatically isolate it so that it is not visible to other users |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
|
This error: query error: code: 1063, message: Permission denied: privilege [Create] is required on 'default'.'bladedb'.* for user 'bladeuser'@'%' with roles [public] means the go driver session confirm the user bladeuser only has role You can try this on your local bendsql: create user bladeuser identified by 'bladeuser' with default_role='bladerole';
create role bladerole;
grant ownership on bladedb.* to role bladerole;
grant role bladerole to user bladerole;
-- use user bladerole create or do any operator under database `default.bladedb` |
Beta Was this translation helpful? Give feedback.
-
|
For more info about ownership and privilege, can ref: https://docs.databend.com/guides/security/access-control/ownership |
Beta Was this translation helpful? Give feedback.
-
If you want to know why the session only has one role |
Beta Was this translation helpful? Give feedback.
-
The user bladeuser default role is public; You can use: or create user assign default role: |
Beta Was this translation helpful? Give feedback.
-
|
OK solved 3Q! |
Beta Was this translation helpful? Give feedback.




For more info about ownership and privilege, can ref:
https://docs.databend.com/guides/security/access-control/ownership
https://docs.databend.com/guides/security/access-control/roles
https://docs.databend.com/guides/security/access-control/privileges