|
|
@ -1,5 +1,5 @@ |
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
import { AppEvents } from 'nocodb-sdk'; |
|
|
|
import { AppEvents, ProjectRoles } from 'nocodb-sdk'; |
|
|
|
import type { |
|
|
|
import type { |
|
|
|
SharedViewReqType, |
|
|
|
SharedViewReqType, |
|
|
|
UserType, |
|
|
|
UserType, |
|
|
@ -82,8 +82,9 @@ export class ViewsService { |
|
|
|
// todo: user roles
|
|
|
|
// todo: user roles
|
|
|
|
//await View.list(param.tableId)
|
|
|
|
//await View.list(param.tableId)
|
|
|
|
const filteredViewList = viewList.filter((view: any) => { |
|
|
|
const filteredViewList = viewList.filter((view: any) => { |
|
|
|
return Object.keys(param?.user?.roles).some( |
|
|
|
return Object.values(ProjectRoles).some( |
|
|
|
(role) => param?.user?.roles[role] && !view.disabled[role], |
|
|
|
(role) => |
|
|
|
|
|
|
|
param?.user?.['project_roles']?.[role] && !view.disabled[role], |
|
|
|
); |
|
|
|
); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|