Browse Source

fix: replace model with view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5239/head
Pranav C 2 years ago
parent
commit
e6116cf7ef
  1. 4
      packages/nocodb/src/lib/services/modelVisibilityService.ts

4
packages/nocodb/src/lib/services/modelVisibilityService.ts

@ -1,8 +1,8 @@
import { VisibilityRuleReqType } from 'nocodb-sdk'; import { VisibilityRuleReqType } from 'nocodb-sdk';
import { NcError } from '../meta/helpers/catchError'; import { NcError } from '../meta/helpers/catchError';
import Model from '../models/Model';
import ModelRoleVisibility from '../models/ModelRoleVisibility'; import ModelRoleVisibility from '../models/ModelRoleVisibility';
import { T } from 'nc-help'; import { T } from 'nc-help';
import { Model, View } from '../models';
export async function xcVisibilityMetaSetAll(param: { export async function xcVisibilityMetaSetAll(param: {
visibilityRule: VisibilityRuleReqType; visibilityRule: VisibilityRuleReqType;
@ -11,7 +11,7 @@ export async function xcVisibilityMetaSetAll(param: {
T.emit('evt', { evt_type: 'uiAcl:updated' }); T.emit('evt', { evt_type: 'uiAcl:updated' });
for (const d of param.visibilityRule) { for (const d of param.visibilityRule) {
for (const role of Object.keys(d.disabled)) { for (const role of Object.keys(d.disabled)) {
const view = await Model.get(d.id); const view = await View.get(d.id);
if (view.project_id !== param.projectId) { if (view.project_id !== param.projectId) {
NcError.badRequest('View does not belong to the project'); NcError.badRequest('View does not belong to the project');

Loading…
Cancel
Save