Fix connector naming in strict mode
In strict mode, creating properties on strings is not allowed. As a result, creating a new datasource fails with the following error: TypeError: Cannot create data source "db": Cannot create property 'name' on string 'mongodb' In this commit, we fix the code to assign the connector name only if the connector is an object (not a string). Add "returnOnlyRoleNames" option to Role.getRoles Currently the return type of Role.getRoles() method is inconsistent: role names are returned for smart roles and role ids are returned for static roles (configured through user-role mapping). This commit adds a new option to Role.getRoles() allowing the caller to request role names to be returned for all types of roles.
This commit is contained in:
parent
ca3ec134d6
commit
94c786f2f7
|
@ -423,7 +423,7 @@ function dataSourcesFromConfig(name, config, connectorRegistry, registry) {
|
|||
config.connector = require(connectorPath);
|
||||
}
|
||||
}
|
||||
if (!config.connector.name)
|
||||
if (config.connector && typeof config.connector === 'object' && !config.connector.name)
|
||||
config.connector.name = name;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue