Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const APP_LIST_FOR_READONLY_ROLE = [APP_ID_HOME, APP_ID_DASHBOARDS, APP_ID_OPENS
const GLOBAL_TENANT_RENDERING_TEXT = 'Global';
const PRIVATE_TENANT_RENDERING_TEXT = 'Private';
const GLOBAL_TENANT = '';
const PRIVATE_TENANT = '__user__';

export class SecurityPlugin
implements
Expand Down Expand Up @@ -169,9 +170,9 @@ export class SecurityPlugin
dataType: 'string',
render: (value: any[][]) => {
let text = value[0][0];
if (text === null || text === GLOBAL_TENANT) {
if (isGlobalTenant(text)) {
text = GLOBAL_TENANT_RENDERING_TEXT;
} else if (text.startsWith('__user__')) {
} else if (isPrivateTenant(text)) {
text = PRIVATE_TENANT_RENDERING_TEXT;
}
text = i18n.translate('savedObjectsManagement.objectsTable.table.columnTenantName', {
Expand Down Expand Up @@ -213,3 +214,11 @@ export class SecurityPlugin

public stop() {}
}

function isPrivateTenant(selectedTenant: string) {
return selectedTenant.startsWith('__user__');
}

function isGlobalTenant(selectedTenant: string) {
return selectedTenant === null || selectedTenant === GLOBAL_TENANT;
}