How to enable/disable custom plugin for particular user/spaces?

Hi, I'm currently using Kibana 7.10, where I created a custom plugin that reflects the side navigation bar. Now I want to allow access for a specific user or space. Previously it was available for Kibana 7.6, now it has been deprecated.

Can some one help me out ?

Thanks in advance

Previously it was available for Kibana 7.6, now it has been deprecated.

Could you point me to the API which was deprecated here? It should still be possible to do this.

index.js file no more available while generating the custom plugin for kibana7.10.1.
The file contains register features following below:

import { resolve } from 'path';
import { existsSync } from 'fs';


import { i18n } from '@kbn/i18n';

import exampleRoute from './server/routes/example';

export default function (kibana) {
  return new kibana.Plugin({
    require: ['elasticsearch'],
    name: 'scheduler',
    uiExports: {
      app: {
        title: 'Scheduler',
        description: 'dags',
        main: 'plugins/scheduler/app',
        euiIconType:'timelionApp',
      },
      hacks: [
        'plugins/scheduler/hack'
      ],
      styleSheetPaths: [resolve(__dirname, 'public/app.scss'), resolve(__dirname, 'public/app.css')].find(p => existsSync(p)),
    },

    config(Joi) {
      return Joi.object({
        enabled: Joi.boolean().default(true),
      }).default();
    },

    // eslint-disable-next-line no-unused-vars
    init(server, options) {
      const xpackMainPlugin = server.plugins.xpack_main;
      if (xpackMainPlugin) {
        const featureId = 'scheduler';

        xpackMainPlugin.registerFeature({
          id: featureId,
          name: i18n.translate('scheduler.featureRegistry.featureName', {
            defaultMessage: 'scheduler',
          }),
          navLinkId: featureId,
          icon: 'questionInCircle',
          app: [featureId, 'kibana'],
          catalogue: [],
          privileges: {
            all: {
              api: [],
              savedObject: {
                all: [],
                read: [],
              },
              ui: ['show'],
            },
            read: {
              api: [],
              savedObject: {
                all: [],
                read: [],
              },
              ui: ['show'],
            },
          },
        });
      }

      // Add server routes and initialize the plugin here
      exampleRoute(server);
    }
  });
}

The API just moved - now you have to do this in the plugin class on the server side. Check out how the canvas plugin does it: kibana/plugin.ts at master · elastic/kibana · GitHub

Yes, I did the same, but got an issue on that. So i was registered the custom plugin into following path:
x-pack/plugins/features/server/oss_features.ts
Now it is working fine.

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.