Prevent crash if groupIds is not set
This commit is contained in:
@@ -484,7 +484,7 @@ function hasAccessTo(app, user, callback) {
|
||||
|
||||
if (!app.accessRestriction.groups) return callback(null, false);
|
||||
|
||||
if (app.accessRestriction.groups.some(function (gid) { return user.groupIds.indexOf(gid) !== -1; })) return callback(null, true);
|
||||
if (app.accessRestriction.groups.some(function (gid) { return Array.isArray(user.groupIds) && user.groupIds.indexOf(gid) !== -1; })) return callback(null, true);
|
||||
|
||||
callback(null, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user