mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 14:05:05 +02:00
uberf-8425: improve account methods params checks (#9278)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
@@ -119,6 +119,8 @@ export async function getAccountDB (
|
||||
}
|
||||
}
|
||||
|
||||
export const assignableRoles = [AccountRole.Guest, AccountRole.User, AccountRole.Maintainer, AccountRole.Owner]
|
||||
|
||||
export function getRolePower (role: AccountRole): number {
|
||||
return roleOrder[role]
|
||||
}
|
||||
@@ -1612,7 +1614,8 @@ export async function findExistingIntegration (
|
||||
extra: any
|
||||
): Promise<Integration | null> {
|
||||
const { socialId, kind, workspaceUuid } = params
|
||||
if (kind == null || socialId == null || workspaceUuid === undefined) {
|
||||
// Note: workspaceUuid === null is a decent use case for account-wise integration not related to a particular workspace
|
||||
if (kind == null || kind === '' || socialId == null || socialId === '' || workspaceUuid === undefined) {
|
||||
throw new PlatformError(new Status(Severity.ERROR, platform.status.BadRequest, {}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user