-
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
add permission check for bulkCreate when overwrite #198
add permission check for bulkCreate when overwrite #198
Conversation
src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## workspace #198 +/- ##
==========================================
Coverage 66.21% 66.22%
==========================================
Files 3420 3420
Lines 65755 65755
Branches 10589 10589
==========================================
+ Hits 43541 43543 +2
+ Misses 19577 19570 -7
- Partials 2637 2642 +5
Flags with carried forward coverage won't be shown. Click here to find out more. see 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
if (options?.workspaces && options.workspaces.length > 0) { | ||
const permitted = await this.validateMultiWorkspacesPermissions( | ||
options.workspaces, | ||
const isPassedWorkspaces = options?.workspaces && options.workspaces.length > 0; |
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.
Nit: rename isPassedWorkspaces
-> hasTargetWorkspaces
!(await this.validateMultiWorkspacesPermissions( | ||
options.workspaces, | ||
options.workspaces!, |
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.
Let's avoid using non-null assertion, you could do options.workspaces ?? []
instead.
src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
6f09358
to
32eb7ee
Compare
Description
add permission check for bulkCreate when overwrite
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr