mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
* feat: getRepository * getRepository return type * export action * add: acl * feat: setResourceAction * feat: action alias * chore: code struct * feat: removeResourceAction * chore: file name * ignorecase * remove ACL * feat: ACL * feat: role toJSON * using emit * chore: test * feat: plugin-acl * feat: acl with predicate * grant universal action test * grant action test * update resource action test * revoke resource action * usingActionsConfig switch * plugin-ui-schema-storage * remove global acl instance * fix: collection manager with sqlite * add own action listener * add acl middleware * add acl allowConfigure strategy option * add plugin-acl allowConfigure * change acl resourceName * add acl middleware merge params * bugfix * append fields on acl action params * acl middleware parse template * fix: collection-manager migrate Co-authored-by: chenos <chenlinxh@gmail.com>
16 lines
439 B
TypeScript
16 lines
439 B
TypeScript
import PluginACL from '@nocobase/plugin-acl';
|
|
|
|
const availableActionResource = {
|
|
name: 'availableActions',
|
|
actions: {
|
|
list(ctx, next) {
|
|
const aclPlugin: PluginACL = ctx.app.getPlugin('PluginACL');
|
|
const acl = aclPlugin.getACL();
|
|
const availableActions = acl.getAvailableActions();
|
|
ctx.body = Array.from(availableActions.entries()).map((item) => item[1]);
|
|
},
|
|
},
|
|
};
|
|
|
|
export { availableActionResource };
|