Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Nied <peternied@hotmail.com>
Signed-off-by: Kajetan Nobel <k.nobel@routegroup.pl>
  • Loading branch information
kajetan-nobel and peternied authored Oct 30, 2023
1 parent 8ec5413 commit 798ca64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/readonly/readonly_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ export class ReadonlyService extends BaseReadonlyService {
isReadOnlyTenant(authInfo: OpenSearchAuthInfo): boolean {
const currentTenant = authInfo.user_requested_tenant || globalTenantName;

// private tenant is not affected
// private tenants are isolated to individual users that always have read/write permissions
if (isPrivateTenant(currentTenant)) {
return false;
}

return authInfo.tenants[currentTenant] !== true;
let readWriteAccess = authInfo.tenants[currentTenant];
return !readWriteAccess;
}

async isReadonly(request: OpenSearchDashboardsRequest): Promise<boolean> {
Expand Down

0 comments on commit 798ca64

Please sign in to comment.