tachybase_todo/packages/plugin-acl/src/collections/resource-actions.ts
ChengLei Shao bd285e0ba9
Plugin acl (#166)
* 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>
2022-01-24 14:10:35 +08:00

28 lines
510 B
TypeScript

import { CollectionOptions } from '@nocobase/database';
export default {
name: 'rolesResourcesActions',
fields: [
{
type: 'belongsTo',
name: 'resource',
foreignKey: 'rolesResourceId',
target: 'rolesResources',
},
{
type: 'string',
name: 'name',
},
{
type: 'json',
name: 'fields',
defaultValue: [],
},
{
type: 'belongsTo',
name: 'scope',
target: 'rolesResourcesScopes',
},
],
} as CollectionOptions;