diff --git a/packages/nocodb/src/controllers/tables.controller.ts b/packages/nocodb/src/controllers/tables.controller.ts index 5b4969eb76..ea10b4d3c3 100644 --- a/packages/nocodb/src/controllers/tables.controller.ts +++ b/packages/nocodb/src/controllers/tables.controller.ts @@ -38,7 +38,7 @@ export class TablesController { projectId, baseId, includeM2M: includeM2M === 'true', - roles: extractRolesObj(req.user.roles), + roles: extractRolesObj(req.user.project_roles), }), ); } diff --git a/packages/nocodb/src/services/tables.service.ts b/packages/nocodb/src/services/tables.service.ts index f0d1711d94..f4a5250edd 100644 --- a/packages/nocodb/src/services/tables.service.ts +++ b/packages/nocodb/src/services/tables.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import DOMPurify from 'isomorphic-dompurify'; -import { isLinksOrLTAR, isVirtualCol, ModelTypes, UITypes } from 'nocodb-sdk'; +import { isLinksOrLTAR, isVirtualCol, ModelTypes, ProjectRoles, UITypes } from 'nocodb-sdk' import { AppEvents } from 'nocodb-sdk'; import { MetaDiffsService } from './meta-diffs.service'; import { ColumnsService } from './columns.service'; @@ -328,7 +328,7 @@ export class TablesService { const tableViewMapping = viewList.reduce((o, view: any) => { o[view.fk_model_id] = o[view.fk_model_id] || 0; if ( - Object.keys(param.roles).some( + Object.values(ProjectRoles).some( (role) => param.roles[role] && !view.disabled[role], ) ) {