MCPcopy Create free account
hub / github.com/coderwhy/coderhub / checkResource

Method checkResource

src/service/auth.service.js:4–8  ·  view source on GitHub ↗
(tableName, id, userId)

Source from the content-addressed store, hash-verified

2
3class AuthService {
4 async checkResource(tableName, id, userId) {
5 const statement = `SELECT * FROM ${tableName} WHERE id = ? AND user_id = ?;`;
6 const [result] = await connection.execute(statement, [id, userId]);
7 return result.length === 0 ? false: true;
8 }
9}
10
11module.exports = new AuthService();

Callers 1

verifyPermissionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected