add a perms utils file

This commit is contained in:
riley
2017-05-18 14:28:43 -06:00
parent ff75b9474a
commit 6deee7cb80
6 changed files with 12 additions and 19 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ UserSchema.index({
* returns true if a commenter is staff
*/
UserSchema.method('isStaff', function () {
return !!intersection(['ADMIN', 'MODERATOR', 'STAFF'], this.roles).length;
return intersection(['ADMIN', 'MODERATOR', 'STAFF'], this.roles).length !== 0;
});
/**