-
Notifications
You must be signed in to change notification settings - Fork 920
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
[Data Source]Add data source permission wrapper and dataSourceAdmin role #7959
[Data Source]Add data source permission wrapper and dataSourceAdmin role #7959
Conversation
Signed-off-by: yubonluo <[email protected]>
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7959 +/- ##
==========================================
- Coverage 61.09% 60.54% -0.55%
==========================================
Files 3691 3730 +39
Lines 87310 88357 +1047
Branches 13433 13681 +248
==========================================
+ Hits 53340 53497 +157
- Misses 30722 31602 +880
- Partials 3248 3258 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: yubonluo <[email protected]>
…arch-Dashboards into 2.17/data-source-wrapper
...plugins/data_source_management/server/saved_objects/data_source_premission_client_wrapper.ts
Outdated
Show resolved
Hide resolved
...plugins/data_source_management/server/saved_objects/data_source_premission_client_wrapper.ts
Outdated
Show resolved
Hide resolved
It is recommended to add integration test for new introduced saved objects wrapper, we can add that in a following PR, as well as to cover some missing branches in |
And thanks for the quick update on the comment, the PR looks amazing to me. We finally have API level access control on data sources. |
...plugins/data_source_management/server/saved_objects/data_source_premission_client_wrapper.ts
Show resolved
Hide resolved
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
...plugins/data_source_management/server/saved_objects/data_source_premission_client_wrapper.ts
Outdated
Show resolved
Hide resolved
...plugins/data_source_management/server/saved_objects/data_source_premission_client_wrapper.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
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.
Nice refactor!
|
…ole (#7959) * Add data source permission wrapper Signed-off-by: yubonluo <[email protected]> * Changeset file for PR #7959 created/updated * optimize the config schema Signed-off-by: yubonluo <[email protected]> * optimize the code Signed-off-by: yubonluo <[email protected]> * optimize the code Signed-off-by: yubonluo <[email protected]> * add some coments and optimize the logic Signed-off-by: yubonluo <[email protected]> * optimize the code Signed-off-by: yubonluo <[email protected]> * add unit tests Signed-off-by: yubonluo <[email protected]> * fix test error Signed-off-by: yubonluo <[email protected]> * optimize the code Signed-off-by: yubonluo <[email protected]> * optimize the code Signed-off-by: yubonluo <[email protected]> * Move some logic to workspace wrapper Signed-off-by: yubonluo <[email protected]> * delete useless code Signed-off-by: yubonluo <[email protected]> * delete useless code Signed-off-by: yubonluo <[email protected]> --------- Signed-off-by: yubonluo <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit bc49b8c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ole (#7959) (#8023) * Add data source permission wrapper * Changeset file for PR #7959 created/updated * optimize the config schema * optimize the code * optimize the code * add some coments and optimize the logic * optimize the code * add unit tests * fix test error * optimize the code * optimize the code * Move some logic to workspace wrapper * delete useless code * delete useless code --------- (cherry picked from commit bc49b8c) Signed-off-by: yubonluo <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…ole (#7959) (#8023) * Add data source permission wrapper * Changeset file for PR #7959 created/updated * optimize the config schema * optimize the code * optimize the code * add some coments and optimize the logic * optimize the code * add unit tests * fix test error * optimize the code * optimize the code * Move some logic to workspace wrapper * delete useless code * delete useless code --------- (cherry picked from commit bc49b8c) Signed-off-by: yubonluo <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 260b094) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ole (#7959) (#8023) (#8042) * Add data source permission wrapper * Changeset file for PR #7959 created/updated * optimize the config schema * optimize the code * optimize the code * add some coments and optimize the logic * optimize the code * add unit tests * fix test error * optimize the code * optimize the code * Move some logic to workspace wrapper * delete useless code * delete useless code --------- (cherry picked from commit bc49b8c) (cherry picked from commit 260b094) Signed-off-by: yubonluo <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
Adding a permission wrapper to control the permissions of data source to create/update/delete according the
data_source_management.manageableBy
.Adding a dataSourceAdmin role to have the all permissions to access data sources.
Issues Resolved
#8009
Screenshot
Data source admin can operate data source
If data source is managed by none, any user(Except for dataSourceAdmin) can not operate data source
If data source is managed by all, any user can operate data source
If data source is managed by dashboard admin, only admin user can operate data source
user is not dashboard admin
uses is dashboard admin
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration