kibana/x-pack/plugins/saved_objects_tagging
Spencer c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
..
common
public
server Changes tag saved object namespaceType to multiple-isolated (#106341) 2021-08-09 13:03:14 -04:00
jest.config.js
kibana.json Adds team details to core/telemetry/localization-owned plugins (#107843) 2021-08-09 20:45:25 -04:00
README.md
tsconfig.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00

SavedObjectsTagging

Add tagging capability to saved objects

Integrating tagging on a new object type

In addition to use the UI api to plug the tagging feature in your application, there is a couple things that needs to be done on the server:

Add read-access to the tag SO type to your feature's capabilities

In order to be able to fetch the tags assigned to an object, the user must have read permission for the tag saved object type. Which is why all features relying on SO tagging must update their capabilities.

features.registerKibanaFeature({
  id: 'myFeature',
  // ...
  privileges: {
    all: {
      // ...
      savedObject: {
        all: ['some-type'],
        read: ['tag'], // <-- HERE
      },
    },
    read: {
      // ...
      savedObject: {
        all: [],
        read: ['some-type', 'tag'], // <-- AND HERE
      },
    },
  },
});

Update the SOT telemetry collector schema to add the new type

The schema is located here: x-pack/plugins/saved_objects_tagging/server/usage/schema.ts. You just need to add the name of the SO type you are adding.

export const tagUsageCollectorSchema: MakeSchemaFrom<TaggingUsageData> = {
  // ...
  types: {
    dashboard: perTypeSchema,
    visualization: perTypeSchema,
    // <-- add your type here
  },
};

Update the taggableTypes constant to add your type

Edit the taggableTypes list in x-pack/plugins/saved_objects_tagging/common/constants.ts to add the name of the type you are adding.