Skip to content

Commit

Permalink
fix: bootstrap error
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe committed Aug 4, 2023
1 parent 2fdd9b7 commit 98e674c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/public/saved_objects/saved_objects_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export class SavedObjectsClient {
namespaces: 'namespaces',
preference: 'preference',
workspaces: 'workspaces',
queryDSL: 'queryDSL',
};

const workspaces = [
Expand Down
5 changes: 4 additions & 1 deletion src/core/server/saved_objects/permission_control/acl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ export class ACL {
}

for (const permissionType of permissionTypes) {
this.permissions[permissionType] = deleteFromPrincipals(
const result = deleteFromPrincipals(
this.permissions![permissionType],
principals.users,
principals.groups
);
if (result) {
this.permissions[permissionType] = result;
}
}

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { SavedObjectsPermissionControlContract } from './client';

export const savedObjectsPermissionControlMock: SavedObjectsPermissionControlContract = {
Expand All @@ -11,4 +10,5 @@ export const savedObjectsPermissionControlMock: SavedObjectsPermissionControlCon
batchValidate: jest.fn(),
getPrinciplesOfObjects: jest.fn(),
getPermittedWorkspaceIds: jest.fn(),
getPrincipalsFromRequest: jest.fn(),
};

0 comments on commit 98e674c

Please sign in to comment.