Record<string, boolean>
| Catalogue capabilities. Catalogue entries drive the visibility of the Kibana homepage options. |
+| [management](./kibana-plugin-public.capabilities.management.md) | {`` [sectionId: string]: Record<string, boolean>;`` }
| Management section capabilities. |
+| [navLinks](./kibana-plugin-public.capabilities.navlinks.md) | Record<string, boolean>
| Navigation link capabilities. |
+
diff --git a/docs/development/core/public/kibana-plugin-public.capabilities.navlinks.md b/docs/development/core/public/kibana-plugin-public.capabilities.navlinks.md
new file mode 100644
index 000000000000..b837dbd5dd54
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.capabilities.navlinks.md
@@ -0,0 +1,11 @@
+[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [Capabilities](./kibana-plugin-public.capabilities.md) > [navLinks](./kibana-plugin-public.capabilities.navlinks.md)
+
+## Capabilities.navLinks property
+
+Navigation link capabilities.
+
+Signature:
+
+```typescript
+navLinks: Record() => Capabilities
| Gets the read-only capabilities. |
+
diff --git a/docs/development/core/public/kibana-plugin-public.coresetup.capabilities.md b/docs/development/core/public/kibana-plugin-public.coresetup.capabilities.md
new file mode 100644
index 000000000000..5e1863af09c9
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.coresetup.capabilities.md
@@ -0,0 +1,9 @@
+[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [capabilities](./kibana-plugin-public.coresetup.capabilities.md)
+
+## CoreSetup.capabilities property
+
+Signature:
+
+```typescript
+capabilities: CapabilitiesSetup;
+```
diff --git a/docs/development/core/public/kibana-plugin-public.coresetup.md b/docs/development/core/public/kibana-plugin-public.coresetup.md
index a34c13b94412..13384b87d5d8 100644
--- a/docs/development/core/public/kibana-plugin-public.coresetup.md
+++ b/docs/development/core/public/kibana-plugin-public.coresetup.md
@@ -15,6 +15,7 @@ export interface CoreSetup
| Property | Type | Description |
| --- | --- | --- |
| [basePath](./kibana-plugin-public.coresetup.basepath.md) | BasePathSetup
| |
+| [capabilities](./kibana-plugin-public.coresetup.capabilities.md) | CapabilitiesSetup
| |
| [chrome](./kibana-plugin-public.coresetup.chrome.md) | ChromeSetup
| |
| [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md) | FatalErrorsSetup
| |
| [http](./kibana-plugin-public.coresetup.http.md) | HttpSetup
| |
diff --git a/docs/development/core/public/kibana-plugin-public.md b/docs/development/core/public/kibana-plugin-public.md
index 372592c9f581..485eb4a0700a 100644
--- a/docs/development/core/public/kibana-plugin-public.md
+++ b/docs/development/core/public/kibana-plugin-public.md
@@ -14,6 +14,8 @@
| Interface | Description |
| --- | --- |
+| [Capabilities](./kibana-plugin-public.capabilities.md) | The read-only set of capabilities available for the current UI session. Capabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID, and the boolean is a flag indicating if the capability is enabled or disabled. |
+| [CapabilitiesSetup](./kibana-plugin-public.capabilitiessetup.md) | Capabilities Setup. |
| [ChromeBrand](./kibana-plugin-public.chromebrand.md) | |
| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | |
| [CoreSetup](./kibana-plugin-public.coresetup.md) | Core services exposed to the start lifecycle |
diff --git a/docs/development/security/rbac.asciidoc b/docs/development/security/rbac.asciidoc
index 916ec72ab76c..6feb499f5887 100644
--- a/docs/development/security/rbac.asciidoc
+++ b/docs/development/security/rbac.asciidoc
@@ -32,9 +32,9 @@ Authorization: Basic kibana changeme
"actions":[
"version:7.0.0-alpha1-SNAPSHOT",
"action:login",
- "action:saved_objects/dashboard/get",
- "action:saved_objects/dashboard/bulk_get",
- "action:saved_objects/dashboard/find",
+ "saved_object:dashboard/get",
+ "saved_object:dashboard/bulk_get",
+ "saved_object:dashboard/find",
...
],"metadata":{}}
}
@@ -90,7 +90,7 @@ Authorization: Basic foo_read_only_user password
"application":"kibana-.kibana",
"resources":["*"],
"privileges":[
- "action:saved_objects/dashboard/save",
+ "saved_object:dashboard/save",
]
}
]
@@ -120,7 +120,7 @@ Authorization: Basic foo_legacy_user password
"application":"kibana-.kibana",
"resources":["*"],
"privileges":[
- "action:saved_objects/dashboard/save"
+ "saved_object:dashboard/save"
]
}
],
@@ -152,7 +152,7 @@ Here is an example response if the user does not have application privileges, bu
"application": {
"kibana-.kibana": {
"*": {
- "action:saved_objects/dashboard/save": false
+ "saved_object:dashboard/save": false
}
}
}
diff --git a/packages/kbn-plugin-generator/sao_template/sao.test.js b/packages/kbn-plugin-generator/sao_template/sao.test.js
index 7d12041cf025..77c9b4533b9c 100755
--- a/packages/kbn-plugin-generator/sao_template/sao.test.js
+++ b/packages/kbn-plugin-generator/sao_template/sao.test.js
@@ -55,6 +55,7 @@ describe('plugin generator sao integration', () => {
expect(uiExports).not.toContain('app:');
expect(uiExports).not.toContain('hacks:');
expect(uiExports).not.toContain('init(server, options)');
+ expect(uiExports).not.toContain('registerFeature(');
});
it('includes app when answering yes', async () => {
@@ -73,8 +74,9 @@ describe('plugin generator sao integration', () => {
const uiExports = getConfig(res.files['index.js']);
expect(uiExports).toContain('app:');
+ expect(uiExports).toContain('init(server, options)');
+ expect(uiExports).toContain('registerFeature(');
expect(uiExports).not.toContain('hacks:');
- expect(uiExports).not.toContain('init(server, options)');
});
it('includes hack when answering yes', async () => {
@@ -94,7 +96,8 @@ describe('plugin generator sao integration', () => {
const uiExports = getConfig(res.files['index.js']);
expect(uiExports).toContain('app:');
expect(uiExports).toContain('hacks:');
- expect(uiExports).not.toContain('init(server, options)');
+ expect(uiExports).toContain('init(server, options)');
+ expect(uiExports).toContain('registerFeature(');
});
it('includes server api when answering yes', async () => {
@@ -115,6 +118,7 @@ describe('plugin generator sao integration', () => {
expect(uiExports).toContain('app:');
expect(uiExports).toContain('hacks:');
expect(uiExports).toContain('init(server, options)');
+ expect(uiExports).toContain('registerFeature(');
});
it('plugin config has correct name and main path', async () => {
diff --git a/packages/kbn-plugin-generator/sao_template/template/index.js b/packages/kbn-plugin-generator/sao_template/template/index.js
index 788ea2d3e338..8377ff8d074c 100755
--- a/packages/kbn-plugin-generator/sao_template/template/index.js
+++ b/packages/kbn-plugin-generator/sao_template/template/index.js
@@ -3,6 +3,11 @@ import { resolve } from 'path';
import { existsSync } from 'fs';
<% } -%>
+
+<% if (generateApp) { -%>
+import { i18n } from '@kbn/i18n';
+<% } -%>
+
<% if (generateApi) { -%>
import exampleRoute from './server/routes/example';
@@ -34,11 +39,49 @@ export default function (kibana) {
enabled: Joi.boolean().default(true),
}).default();
},
- <%_ if (generateApi) { -%>
+ <%_ if (generateApi || generateApp) { -%>
init(server, options) { // eslint-disable-line no-unused-vars
+ <%_ if (generateApp) { -%>
+ const xpackMainPlugin = server.plugins.xpack_main;
+ if (xpackMainPlugin) {
+ const featureId = '<%= snakeCase(name) %>';
+
+ xpackMainPlugin.registerFeature({
+ id: featureId,
+ name: i18n.translate('<%= camelCase(name) %>.featureRegistry.featureName', {
+ defaultMessage: '<%= name %>',
+ }),
+ navLinkId: featureId,
+ icon: 'questionInCircle',
+ app: [featureId, 'kibana'],
+ catalogue: [],
+ privileges: {
+ all: {
+ api: [],
+ savedObject: {
+ all: [],
+ read: ['config'],
+ },
+ ui: ['show'],
+ },
+ read: {
+ api: [],
+ savedObject: {
+ all: [],
+ read: ['config'],
+ },
+ ui: ['show'],
+ },
+ },
+ });
+ }
+ <%_ } -%>
+
+ <%_ if (generateApi) { -%>
// Add server routes and initialize the plugin here
exampleRoute(server);
+ <%_ } -%>
}
<%_ } -%>
});
diff --git a/packages/kbn-ui-framework/src/components/table/listing_table/listing_table.js b/packages/kbn-ui-framework/src/components/table/listing_table/listing_table.js
index ad15d94b345c..ba3bf91fcdf1 100644
--- a/packages/kbn-ui-framework/src/components/table/listing_table/listing_table.js
+++ b/packages/kbn-ui-framework/src/components/table/listing_table/listing_table.js
@@ -47,6 +47,7 @@ export function KuiListingTable({
toolBarActions,
onFilter,
onItemSelectionChanged,
+ enableSelection,
selectedRowIds,
filter,
prompt,
@@ -76,11 +77,12 @@ export function KuiListingTable({
}
}
- function renderTableRows() {
+ function renderTableRows(enableSelection) {
return rows.map((row, rowIndex) => {
return (