From 8f29fde00874b65085905ada7b7fa374cfcea047 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 8 Oct 2023 13:13:02 +0800 Subject: [PATCH] Revert "fix(acl): add rolesUsers through collection" This reverts commit 86309e33bef478056d948a7ea233e3832bfabb22. # Conflicts: # packages/plugins/@nocobase/plugin-acl/src/server/server.ts --- .../@nocobase/plugin-acl/src/server/server.ts | 40 ------------------- ...> 20221101111110-update-foreign-fields.ts} | 2 +- .../plugin-users/src/server/server.ts | 1 + 3 files changed, 2 insertions(+), 41 deletions(-) rename packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/{20221101111111-update-foreign-fields.ts => 20221101111110-update-foreign-fields.ts} (94%) diff --git a/packages/plugins/@nocobase/plugin-acl/src/server/server.ts b/packages/plugins/@nocobase/plugin-acl/src/server/server.ts index 98df99611..e9e522cb2 100644 --- a/packages/plugins/@nocobase/plugin-acl/src/server/server.ts +++ b/packages/plugins/@nocobase/plugin-acl/src/server/server.ts @@ -381,46 +381,6 @@ export class PluginACL extends Plugin { default: true, }, }); - const data = { - name: 'rolesUsers', - title: 'rolesUsers', - hidden: true, - fields: [ - { - name: 'roleName', - type: 'string', - interface: 'input', - isForeignKey: true, - uiSchema: { - type: 'string', - title: 'roleName', - 'x-component': 'Input', - 'x-read-pretty': true, - }, - }, - { - name: 'userId', - type: 'bigInt', - interface: 'integer', - isForeignKey: true, - uiSchema: { - type: 'number', - title: 'userId', - 'x-component': 'InputNumber', - 'x-read-pretty': true, - }, - }, - ], - timestamps: true, - autoGenId: false, - autoCreate: true, - isThrough: true, - sortable: false, - }; - const r = this.db.getRepository('collections'); - if (r) { - await r.create({ values: data }); - } }); this.app.on('beforeInstallPlugin', async (plugin) => { diff --git a/packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/20221101111111-update-foreign-fields.ts b/packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/20221101111110-update-foreign-fields.ts similarity index 94% rename from packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/20221101111111-update-foreign-fields.ts rename to packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/20221101111110-update-foreign-fields.ts index a07f85f9d..0bc430b7b 100644 --- a/packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/20221101111111-update-foreign-fields.ts +++ b/packages/plugins/@nocobase/plugin-collection-manager/src/server/migrations/20221101111110-update-foreign-fields.ts @@ -3,7 +3,7 @@ import { afterCreateForForeignKeyField } from '../hooks/afterCreateForForeignKey export default class DropForeignKeysMigration extends Migration { async up() { - const result = await this.app.version.satisfies('<0.14.0-alpha.8'); + const result = await this.app.version.satisfies('<0.8.0'); if (!result) { return; diff --git a/packages/plugins/@nocobase/plugin-users/src/server/server.ts b/packages/plugins/@nocobase/plugin-users/src/server/server.ts index 9c009462f..b1f5f811f 100644 --- a/packages/plugins/@nocobase/plugin-users/src/server/server.ts +++ b/packages/plugins/@nocobase/plugin-users/src/server/server.ts @@ -9,6 +9,7 @@ import * as actions from './actions/users'; import initAuthenticators from './authenticators'; import { JwtOptions, JwtService } from './jwt-service'; import { enUS, zhCN } from './locale'; +import { parseToken } from './middlewares'; export interface UserPluginConfig { name?: string;