mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:46:00 +00:00
fix(acl): add rolesUsers through collection
This commit is contained in:
parent
1b3b07f029
commit
86309e33be
@ -381,6 +381,43 @@ 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,
|
||||
};
|
||||
await this.db.getRepository('collections').create({ values: data });
|
||||
});
|
||||
|
||||
this.app.on('beforeInstallPlugin', async (plugin) => {
|
||||
|
@ -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.8.0');
|
||||
const result = await this.app.version.satisfies('<0.14.0-alpha.8');
|
||||
|
||||
if (!result) {
|
||||
return;
|
@ -9,7 +9,6 @@ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user