SoftwareBrothers / adminjs-import-export

MIT License
5 stars 25 forks source link

Disable import while maintaining export #6

Open AshotN opened 2 years ago

AshotN commented 2 years ago

Is it possible currently to disable the import function while keeping the export?

qradle commented 2 years ago

I fixed that with following:

features: [
  importExportFeature(),
  ({ actions }) => {
    delete actions.import;
    return { actions };
  },
],
AshotN commented 2 years ago

That's pretty smart. It doesn't cause any issues?

Upasana-Jha commented 1 year ago

You could also do

features: [
  importExportFeature(),
],
options: {
      actions: {
          import: { isAccessible: false }
      }
}