|
|
@ -1,9 +1,13 @@ |
|
|
|
import { OrgUserRoles } from 'nocodb-sdk'; |
|
|
|
import { |
|
|
|
|
|
|
|
AuditOperationSubTypes, |
|
|
|
|
|
|
|
AuditOperationTypes, |
|
|
|
|
|
|
|
OrgUserRoles, |
|
|
|
|
|
|
|
PluginCategory, |
|
|
|
|
|
|
|
} from 'nocodb-sdk'; |
|
|
|
import { T } from 'nc-help'; |
|
|
|
import { T } from 'nc-help'; |
|
|
|
import validator from 'validator'; |
|
|
|
import validator from 'validator'; |
|
|
|
import { v4 as uuidv4 } from 'uuid'; |
|
|
|
import { v4 as uuidv4 } from 'uuid'; |
|
|
|
import * as ejs from 'ejs'; |
|
|
|
import * as ejs from 'ejs'; |
|
|
|
import { PluginCategory } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
import { validatePayload } from '../meta/api/helpers'; |
|
|
|
import { validatePayload } from '../meta/api/helpers'; |
|
|
|
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
|
|
|
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
|
|
|
import ProjectUser from '../models/ProjectUser'; |
|
|
|
import ProjectUser from '../models/ProjectUser'; |
|
|
@ -91,8 +95,8 @@ export async function userInvite(param: { |
|
|
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
await Audit.insert({ |
|
|
|
project_id: param.projectId, |
|
|
|
project_id: param.projectId, |
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
op_sub_type: 'INVITE', |
|
|
|
op_sub_type: AuditOperationSubTypes.INVITE, |
|
|
|
user: param.req.user.email, |
|
|
|
user: param.req.user.email, |
|
|
|
description: `invited ${email} to ${param.projectId} project `, |
|
|
|
description: `invited ${email} to ${param.projectId} project `, |
|
|
|
ip: param.req.clientIp, |
|
|
|
ip: param.req.clientIp, |
|
|
@ -120,8 +124,8 @@ export async function userInvite(param: { |
|
|
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
await Audit.insert({ |
|
|
|
project_id: param.projectId, |
|
|
|
project_id: param.projectId, |
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
op_sub_type: 'INVITE', |
|
|
|
op_sub_type: AuditOperationSubTypes.INVITE, |
|
|
|
user: param.req.user.email, |
|
|
|
user: param.req.user.email, |
|
|
|
description: `invited ${email} to ${param.projectId} project `, |
|
|
|
description: `invited ${email} to ${param.projectId} project `, |
|
|
|
ip: param.req.clientIp, |
|
|
|
ip: param.req.clientIp, |
|
|
@ -202,8 +206,8 @@ export async function projectUserUpdate(param: { |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
await Audit.insert({ |
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
op_sub_type: 'ROLES_MANAGEMENT', |
|
|
|
op_sub_type: AuditOperationSubTypes.ROLES_MANAGEMENT, |
|
|
|
user: param.req.user.email, |
|
|
|
user: param.req.user.email, |
|
|
|
description: `updated roles for ${user.email} with ${param.projectUser.roles} `, |
|
|
|
description: `updated roles for ${user.email} with ${param.projectUser.roles} `, |
|
|
|
ip: param.req.clientIp, |
|
|
|
ip: param.req.clientIp, |
|
|
@ -274,8 +278,8 @@ export async function projectUserInviteResend(param: { |
|
|
|
await sendInviteEmail(user.email, invite_token, param.req); |
|
|
|
await sendInviteEmail(user.email, invite_token, param.req); |
|
|
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
await Audit.insert({ |
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
op_sub_type: 'RESEND_INVITE', |
|
|
|
op_sub_type: AuditOperationSubTypes.RESEND_INVITE, |
|
|
|
user: user.email, |
|
|
|
user: user.email, |
|
|
|
description: `resent a invite to ${user.email} `, |
|
|
|
description: `resent a invite to ${user.email} `, |
|
|
|
ip: param.req.clientIp, |
|
|
|
ip: param.req.clientIp, |
|
|
|