privileges,planner: implement checks for RESTRICTED_USER_ADMIN for granting privileges and roles#64297
Conversation
…d roles Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #64297 +/- ##
================================================
+ Coverage 72.7524% 74.8328% +2.0804%
================================================
Files 1859 1867 +8
Lines 504107 522478 +18371
================================================
+ Hits 366750 390985 +24235
+ Misses 115098 109718 -5380
+ Partials 22259 21775 -484
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, xhebox The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #64295
Problem Summary:
The current implementation of SEM is not good enough (for both v1 and v2). We'll need to restrict the granting and revoking of roles which have
RESTRICTED_USER_ADMIN, or the user withROLE ADMINpermission can easy take the higher privilege.What changed and how does it work?
RESTRICTED_USER_ADMINare not allowed to be deletedRESTRICTED_USER_ADMINare not allowed to have their names modifiedRESTRICTED_USER_ADMINpermission are not allowed to change permissions.RESTRICTED_USER_ADMINattribute is not allowed to be used as a role.Users with
RESTRICTED_USER_ADMINare not limited by these four rules.Check List
Tests
Side effects
Documentation
Release note