We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8845b5a commit 3ba41c7Copy full SHA for 3ba41c7
src/common/helper.js
@@ -84,6 +84,9 @@ function autoWrapExpress (obj) {
84
* @param {Object} authUser the user
85
*/
86
function hasAdminRole (authUser) {
87
+ if (!authUser || !Array.isArray(authUser.roles)) {
88
+ return false
89
+ }
90
for (let i = 0; i < authUser.roles.length; i++) {
91
if (authUser.roles[i].toLowerCase() === constants.UserRoles.Admin.toLowerCase()) {
92
return true
0 commit comments