mirror of
https://github.com/FlowiseAI/Flowise.git
synced 2026-10-12 02:02:17 +00:00
@@ -162,6 +162,11 @@ export class LoginMethodController {
|
||||
public async testConfig(req: Request, res: Response, next: NextFunction) {
|
||||
let queryRunner
|
||||
try {
|
||||
this.assertEnterprisePlatform()
|
||||
|
||||
const user = getLoggedInUser(req)
|
||||
assertQueryOrganizationMatchesActiveOrg(user, req.body.organizationId)
|
||||
|
||||
const providers = req.body.providers as { config: Record<string, unknown> }[]
|
||||
const providerName = req.body.providerName as string
|
||||
const organizationId = req.body.organizationId as string | undefined
|
||||
|
||||
@@ -122,6 +122,8 @@ export class RoleService {
|
||||
|
||||
const oldRole = await this.readRoleById(newRole.id, queryRunner)
|
||||
if (!oldRole) throw new InternalFlowiseError(StatusCodes.NOT_FOUND, RoleErrorMessage.ROLE_NOT_FOUND)
|
||||
if (newRole.organizationId !== oldRole.organizationId)
|
||||
throw new InternalFlowiseError(StatusCodes.NOT_FOUND, RoleErrorMessage.ROLE_NOT_FOUND)
|
||||
const user = await this.userService.readUserById(newRole.updatedBy, queryRunner)
|
||||
if (!user) throw new InternalFlowiseError(StatusCodes.NOT_FOUND, UserErrorMessage.USER_NOT_FOUND)
|
||||
if (newRole.name) this.validateRoleName(newRole.name)
|
||||
|
||||
Reference in New Issue
Block a user