Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 11x 29x 29x 11x | const { GetCommand } = require('@aws-sdk/lib-dynamodb')
/**
* True when the caller is a platform administrator (`isPlatformAdmin` on their
* UsersTable row), who may manage any entity's comments and any store pack.
*/
async function isPlatformAdminUser(docClient, userId) {
const result = await docClient.send(
new GetCommand({ TableName: process.env.USERS_TABLE_NAME, Key: { id: userId } })
)
return result.Item?.isPlatformAdmin === true
}
module.exports = { isPlatformAdminUser }
|