mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
chore: migrate deprecated util.isArray
Deprecated: Use Array.isArray() instead. Source: https://nodejs.org/docs/latest-v18.x/api/util.html#utilisarrayobject
This commit is contained in:
@@ -25,7 +25,7 @@ function hasPermission(userScope,permission) {
|
||||
}
|
||||
var i;
|
||||
|
||||
if (util.isArray(permission)) {
|
||||
if (Array.isArray(permission)) {
|
||||
// Multiple permissions requested - check each one
|
||||
for (i=0;i<permission.length;i++) {
|
||||
if (!hasPermission(userScope,permission[i])) {
|
||||
@@ -36,7 +36,7 @@ function hasPermission(userScope,permission) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (util.isArray(userScope)) {
|
||||
if (Array.isArray(userScope)) {
|
||||
if (userScope.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user