Forbid export attempt for readonly users (#9181)

This commit is contained in:
Anton Alexeyev 2025-06-06 11:51:53 +07:00 committed by GitHub
parent 25272e3431
commit 95a2ba3aed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,8 +181,13 @@ export function createServer (storageConfig: StorageConfiguration): { app: Expre
throw new ApiError(400, 'Missing required parameters')
}
const decodedToken = decodeToken(token)
if (decodedToken.extra?.readonly !== undefined) {
throw new ApiError(403, 'Forbidden')
}
const platformClient = await createPlatformClient(token)
const { account } = decodeToken(token)
const account = decodedToken.account
const txOperations = new TxOperations(platformClient, socialId)