Skip to content

Commit 984d802

Browse files
Merge branch 'master' into add-query-inputs-to-geo-tracker
2 parents a4586e0 + dac35cf commit 984d802

File tree

80 files changed

+4273
-730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4273
-730
lines changed

docs/developer/architecture/security/feature-registration.asciidoc

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@ server.route({
198198
=== Example 3: Discover
199199

200200
Discover takes advantage of subfeature privileges to allow fine-grained access control. In this example,
201-
a single "Create Short URLs" subfeature privilege is defined, which allows users to grant access to this feature without having to grant the `all` privilege to Discover. In other words, you can grant `read` access to Discover, and also grant the ability to create short URLs.
201+
two subfeature privileges are defined: "Create Short URLs", and "Generate PDF Reports". These allow users to grant access to this feature without having to grant the `all` privilege to Discover. In other words, you can grant `read` access to Discover, and also grant the ability to create short URLs or generate PDF reports.
202+
203+
Notice the "Generate PDF Reports" subfeature privilege has an additional `minimumPrivilege` option. Kibana will only offer this subfeature privilege if the
204+
license requirement is satisfied.
202205

203206
["source","javascript"]
204207
-----------
@@ -259,6 +262,28 @@ public setup(core, { features }) {
259262
},
260263
],
261264
},
265+
{
266+
groupType: 'independent',
267+
privileges: [
268+
{
269+
id: 'pdf_generate',
270+
name: i18n.translate(
271+
'xpack.features.ossFeatures.discoverGeneratePDFReportsPrivilegeName',
272+
{
273+
defaultMessage: 'Generate PDF Reports',
274+
}
275+
),
276+
minimumLicense: 'platinum',
277+
includeIn: 'all',
278+
savedObject: {
279+
all: [],
280+
read: [],
281+
},
282+
api: ['generatePDFReports'],
283+
ui: ['generatePDFReports'],
284+
},
285+
],
286+
},
262287
],
263288
},
264289
],
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { parsedExternallyDefinedCollector } from './parsed_externally_defined_collector';
21+
import { parsedImportedSchemaCollector } from './parsed_imported_schema';
22+
import { parsedImportedUsageInterface } from './parsed_imported_usage_interface';
23+
import { parsedIndexedInterfaceWithNoMatchingSchema } from './parsed_indexed_interface_with_not_matching_schema';
24+
import { parsedNestedCollector } from './parsed_nested_collector';
25+
import { parsedSchemaDefinedWithSpreadsCollector } from './parsed_schema_defined_with_spreads_collector';
26+
import { parsedWorkingCollector } from './parsed_working_collector';
27+
import { ParsedUsageCollection } from '../ts_parser';
28+
29+
export const allExtractedCollectors: ParsedUsageCollection[] = [
30+
...parsedExternallyDefinedCollector,
31+
...parsedImportedSchemaCollector,
32+
...parsedImportedUsageInterface,
33+
parsedIndexedInterfaceWithNoMatchingSchema,
34+
parsedNestedCollector,
35+
parsedSchemaDefinedWithSpreadsCollector,
36+
parsedWorkingCollector,
37+
];

packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_indexed_interface_with_not_matching_schema.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,14 @@ export const parsedIndexedInterfaceWithNoMatchingSchema: ParsedUsageCollection =
3636
fetch: {
3737
typeName: 'Usage',
3838
typeDescriptor: {
39-
'': {
40-
'@@INDEX@@': {
41-
count_1: {
42-
kind: SyntaxKind.NumberKeyword,
43-
type: 'NumberKeyword',
44-
},
45-
count_2: {
46-
kind: SyntaxKind.NumberKeyword,
47-
type: 'NumberKeyword',
48-
},
39+
'@@INDEX@@': {
40+
count_1: {
41+
kind: SyntaxKind.NumberKeyword,
42+
type: 'NumberKeyword',
43+
},
44+
count_2: {
45+
kind: SyntaxKind.NumberKeyword,
46+
type: 'NumberKeyword',
4947
},
5048
},
5149
},

packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap

Lines changed: 0 additions & 295 deletions
This file was deleted.

0 commit comments

Comments
 (0)