19 lines
315 B
JavaScript
19 lines
315 B
JavaScript
import { HttpError } from './errors';
|
|
|
|
function verifyPrivilege(privilege, user, context) {
|
|
if (!user) {
|
|
throw new HttpError({
|
|
statusMessage: 'You are not authenticated',
|
|
statusCode: 401,
|
|
});
|
|
}
|
|
|
|
console.log('verify privilege', privilege, user, context);
|
|
|
|
return true;
|
|
}
|
|
|
|
export {
|
|
verifyPrivilege,
|
|
};
|