fix(plugin-export): allow to configure in acl

This commit is contained in:
chenos 2022-06-14 22:04:33 +08:00
parent f97b72dc55
commit 5e116af4a9
2 changed files with 5 additions and 9 deletions

View File

@ -2,7 +2,7 @@ export interface AvailableActionOptions {
/**
* @deprecated
*/
type: 'new-data' | 'old-data';
type?: 'new-data' | 'old-data';
displayName?: string;
aliases?: string[] | string;
resource?: string;

View File

@ -9,15 +9,11 @@ export class ExportPlugin extends Plugin {
beforeLoad() {}
async load() {
// Visit: http://localhost:13000/api/xxx:exportXlsx
this.app.resourcer.registerActionHandler('exportXlsx', exportXlsx);
// this.app.resource({
// name: 'export',
// actions: {
// xlsx: exportXlsx,
// },
// });
this.app.acl.allow('*', 'exportXlsx');
this.app.acl.setAvailableAction('exportXlsx', {
displayName: '{{t("Export")}}',
allowConfigureFields: true,
});
}
async install(options: InstallOptions) {}