mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 02:47:41 +08:00
12 lines
290 B
JavaScript
12 lines
290 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,
|
|
};
|