-
Notifications
You must be signed in to change notification settings - Fork 0
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
apply workspace permission check when bulk creating object #66
Conversation
Codecov Report
@@ Coverage Diff @@
## workspace #66 +/- ##
=============================================
+ Coverage 65.85% 65.86% +0.01%
=============================================
Files 3341 3341
Lines 64386 64388 +2
Branches 10050 10051 +1
=============================================
+ Hits 42402 42412 +10
- Misses 19489 19509 +20
+ Partials 2495 2467 -28
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 13 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -96,6 +96,16 @@ export class WorkspaceSavedObjectsClientWrapper { | |||
objects: Array<SavedObjectsBulkCreateObject<T>>, | |||
options: SavedObjectsCreateOptions = {} | |||
): Promise<SavedObjectsBulkResponse<T>> => { | |||
if (options.workspaces) { | |||
options.workspaces = options.workspaces.filter( |
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.
Is that means the bulkCreate
operation will be continued if user don't have permission to any one workspace? The options.workspaces
will be empty, based current logic.
async (workspaceId) => | ||
await this.permissionControl.validate( | ||
workspaceId, | ||
WorkspacePermissionMode.Admin, |
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.
WorkspacePermissionMode.Admin, | |
[WorkspacePermissionMode.Write, WorkspacePermissionMode.Management], |
Should be like this I think? Please rebase the latest code from workspace, the enum and validate function has some changes.
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
01e21a2
to
b4a004f
Compare
* feat: Apply workspace permission check when bulk creating object Signed-off-by: tygao <tygao@amazon.com> * chore: update bulk create function Signed-off-by: tygao <tygao@amazon.com> --------- Signed-off-by: tygao <tygao@amazon.com>
* feat: Apply workspace permission check when bulk creating object Signed-off-by: tygao <tygao@amazon.com> * chore: update bulk create function Signed-off-by: tygao <tygao@amazon.com> --------- Signed-off-by: tygao <tygao@amazon.com>
* feat: Apply workspace permission check when bulk creating object Signed-off-by: tygao <tygao@amazon.com> * chore: update bulk create function Signed-off-by: tygao <tygao@amazon.com> --------- Signed-off-by: tygao <tygao@amazon.com>
* feat: Apply workspace permission check when bulk creating object Signed-off-by: tygao <tygao@amazon.com> * chore: update bulk create function Signed-off-by: tygao <tygao@amazon.com> --------- Signed-off-by: tygao <tygao@amazon.com>
Description
apply workspace permission check when bulk creating object
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr