Browse Source

feat: add option to block user

pull/7917/head
Pranav C 8 months ago
parent
commit
ef0a912814
  1. 18
      packages/nocodb/src/meta/migrations/v2/nc_042_user_block.ts
  2. 3
      packages/nocodb/src/models/User.ts

18
packages/nocodb/src/meta/migrations/v2/nc_042_user_block.ts

@ -0,0 +1,18 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
await knex.schema.createTable(MetaTable.USERS, (table) => {
table.boolean('blocked').defaultTo(false);
table.string('blocked_reason');
});
};
const down = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.USERS, (table) => {
table.dropColumn('blocked');
table.dropColumn('blocked_reason');
});
};
export { up, down };

3
packages/nocodb/src/models/User.ts

@ -33,6 +33,9 @@ export default class User implements UserType {
display_name?: string; display_name?: string;
avatar?: string; avatar?: string;
blocked?: boolean;
blocked_reason?: string;
constructor(data: User) { constructor(data: User) {
Object.assign(this, data); Object.assign(this, data);
} }

Loading…
Cancel
Save