[Data Source]Add data source permission wrapper and dataSourceAdmin role#7959
Conversation
Signed-off-by: yubonluo <yubonluo@amazon.com>
❌ 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 <yubonluo@amazon.com>
…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 <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
...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 <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
|
|
…ole (#7959) * Add data source permission wrapper Signed-off-by: yubonluo <yubonluo@amazon.com> * Changeset file for PR #7959 created/updated * optimize the config schema Signed-off-by: yubonluo <yubonluo@amazon.com> * optimize the code Signed-off-by: yubonluo <yubonluo@amazon.com> * optimize the code Signed-off-by: yubonluo <yubonluo@amazon.com> * add some coments and optimize the logic Signed-off-by: yubonluo <yubonluo@amazon.com> * optimize the code Signed-off-by: yubonluo <yubonluo@amazon.com> * add unit tests Signed-off-by: yubonluo <yubonluo@amazon.com> * fix test error Signed-off-by: yubonluo <yubonluo@amazon.com> * optimize the code Signed-off-by: yubonluo <yubonluo@amazon.com> * optimize the code Signed-off-by: yubonluo <yubonluo@amazon.com> * Move some logic to workspace wrapper Signed-off-by: yubonluo <yubonluo@amazon.com> * delete useless code Signed-off-by: yubonluo <yubonluo@amazon.com> * delete useless code Signed-off-by: yubonluo <yubonluo@amazon.com> --------- Signed-off-by: yubonluo <yubonluo@amazon.com> 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 <yubonluo@amazon.com> 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 <yubonluo@amazon.com> 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 <yubonluo@amazon.com> 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:jestyarn test:jest_integration