mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 00:56:24 +08:00
13 lines
292 B
JavaScript
13 lines
292 B
JavaScript
|
|
/**
|
|
* check will ensure that the user has the desired roles.
|
|
*
|
|
* @param {Object} user user being checked for roles
|
|
* @param {Array<String>} roles roles to check that the user has
|
|
*/
|
|
const check = (user, roles) => roles.some((role) => role === user.role);
|
|
|
|
module.exports = {
|
|
check
|
|
};
|