Skip to content

Commit 95a2ba3

Browse files
authored
Forbid export attempt for readonly users (#9181)
1 parent 25272e3 commit 95a2ba3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/export/pod-export/src/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,13 @@ export function createServer (storageConfig: StorageConfiguration): { app: Expre
181181
throw new ApiError(400, 'Missing required parameters')
182182
}
183183

184+
const decodedToken = decodeToken(token)
185+
if (decodedToken.extra?.readonly !== undefined) {
186+
throw new ApiError(403, 'Forbidden')
187+
}
188+
184189
const platformClient = await createPlatformClient(token)
185-
const { account } = decodeToken(token)
190+
const account = decodedToken.account
186191

187192
const txOperations = new TxOperations(platformClient, socialId)
188193

0 commit comments

Comments
 (0)