-
Notifications
You must be signed in to change notification settings - Fork 742
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
feat(query): task support ownership #15458
base: main
Are you sure you want to change the base?
Conversation
7b8788b
to
1cb5d08
Compare
bb6e048
to
6bcba30
Compare
If this pull request is ready for review, please mark it as Ready for review. If it is not yet ready, I would prefer to be removed from the reviewer list to avoid being overwhelmed by notifications from pushes. 🤔 |
f3f341e
to
5204627
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 13 of 38 files at r1, 13 of 22 files at r3, all commit messages.
Reviewable status: 26 of 40 files reviewed, 4 unresolved discussions (waiting on @TCeason and @ZhiHanZ)
src/meta/proto-conv/src/util.rs
line 122 at r3 (raw file):
(88, "2024-04-17: Add: SequenceMeta"), (89, "2024-04-19: Add: geometry_output_format settings"), (90, "2024-05-09: Add: GrantTaskObject"),
The name of the new message is OwnershipTaskObject
?
Two owenrship.proto added the OwnershipTaskObject user.proto added GrantTaskObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 38 files at r1.
Reviewable status: 27 of 40 files reviewed, 3 unresolved discussions (waiting on @ZhiHanZ)
This pr can be merged when this pr #15496 released. |
628a32a
to
08e0fba
Compare
1. add function: list_task_ownerships, only list task prefix. 2. add visibility in task/task_history system table. 3. refactor showtasks, directly use select * from system.task; 4. fix ut err
Docker Image for PR
|
I generate some case and test this pr in cloud dev: warehouse 'task_p'. So I think we can review this pr now. cc @flaneur2020 @ZhiHanZ |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Ownership cover Task Object
Added Task to OwnershipObject, storing the task name (After confirmation that the task will not have a rename operation, storing the name is more appropriate)
task. proto adds task_names. Added owner judgment in tasks/task_history_table.rs
owenrship.proto added the OwnershipTaskObject
user.proto added GrantTaskObject
Add the global permission to CREATE TASK. drop/alter task requires the DROP/ALTER permission. Only the owner of a task can execute the show/desc/execute task command
Delete showtasksinterpreter
grant task ownership when a task is created and revoke task ownership when a task is dropped
Add list_tasks_ownerships and only list __fd_object_owners//task-by-name/ prefix
if user has global Super privilege, it can execute/drop/alter/create/show all tasks and tasks_history
Attention:
The ddl operation of the task also retains the previous permission verification. That so long as has the Global level of super permissions can be to create a task/drop/execute/desc/show.
Integration testing is somewhat difficult and has been tested manually in the dev environment. warehouse 'task_p'.
Tests
Type of change
This change is