-
Notifications
You must be signed in to change notification settings - Fork 752
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
[RBAC] Support grant role and revoke role #4451
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/databend/databend/2o5FtEohMGWwkB7M9toJ5emGgot3 [Deployment for 45f9a05 canceled] |
Thanks for the contribution! Please review the labels and make any necessary changes. |
/lgtm nice work! ❤️ |
Oops, conflicts |
Signed-off-by: Ye Sijun <junnplus@gmail.com>
Signed-off-by: Ye Sijun <junnplus@gmail.com>
@@ -0,0 +1,78 @@ | |||
// Copyright 2021 Datafuse Labs. |
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.
2022
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.
We can consider removing this time uniformly from license, should be in another PR.
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.
Ok.
Hints:
The time is the file which year created not updated.
@@ -52,7 +52,7 @@ impl Interpreter for DropRoleInterpreter { | |||
let tenant = self.ctx.get_tenant(); | |||
let user_mgr = self.ctx.get_user_manager(); | |||
user_mgr | |||
.drop_role(&tenant, &plan.role_identity, plan.if_exists) | |||
.drop_role(&tenant, plan.role_identity, plan.if_exists) |
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.
do we need to check the role is used(granted) to other user/role before delete?
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.
We can restrict removing roles that are in use, but I'm not sure if we want to do that.
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.
if not restricted, the deleted role exists in other role`s info, which need cleaning up?
maybe we need store the list the role granted to?
we can either refuse delete or do clean up based on it.
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.
In fact, it doesn't matter if there is no restriction, geting privileges will checks if the role exists.
we can either refuse delete or do clean up based on it.
SGTM.
Signed-off-by: Ye Sijun junnplus@gmail.com
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
This PR support grant role and revoke role statement for RBAC.
Changelog
Related Issues
Fixes #4201 #2818
Test Plan
Unit Tests
Stateless Tests