-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GRANT on unknown objects need to be rejected #15982
Comments
Just by looking at the behaviours, the objects seem to be not analyzed. There will be more variations around this but I would presume a single fix will address all. |
I am pretty sure at least for schemas this is intentional, as they are not explicitly created and therefore a user would need to have access to a schema before the first object within it exists. (Personally I'd prefer for schemas to also be explicitly created) |
I don't have a clear opinion if this is a bug or a desired behavior. A bit related, need to test, what happens if you attempt to restore users/roles & their privileges to a new cluster, if the tables/views/schemas are not still there? Maybe it can be handy for such cases to prepare the users/roles & privileges (manually, or with saved statements) before the DB objects are created. Additionally, agreeing with @proddata, since currently we don't have empty schemas, (always need to have the 1st table created within them, and we dont' have a On the other, hand it is weird to select from sys.privileges and see privs for object not existing on the cluster. |
I'm guessing that after: #11939, we can consider implementing the explicit creation/dropping of schemas. |
After discussion we decided to treat this as an improvement, rather than a bug fix. |
Some extra info, currently you can restore USERMANAGEMENT, and the privileges are there even though the objects are not:
If we go ahead to implement throw errors when trying to grant privs on non-existing objects, this will contradict with the restore privs behavior. |
I would maintain the current behavior until we decide to explicitly create schemas. Once we do, we can more closely link privileges to objects and potentially drop privileges if the associated object no longer exists. |
CrateDB version
latest master
CrateDB setup information
No response
Problem description
Please see steps to reproduce.
Steps to Reproduce
Actual Result
Privileges on unknown objects granted.
Expected Result
Such stmts need to be rejected.
The text was updated successfully, but these errors were encountered: