mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 22:36:57 +02:00
Merge pull request #3496 from birarda/domain-wizard
fix for domain-server allowed roles
This commit is contained in:
commit
4559c8a9ca
1 changed files with 2 additions and 3 deletions
|
@ -1573,14 +1573,13 @@ void DomainServer::handleProfileRequestFinished() {
|
||||||
// pull the user roles from the response
|
// pull the user roles from the response
|
||||||
QJsonArray userRolesArray = profileJSON.object()["data"].toObject()["user"].toObject()["roles"].toArray();
|
QJsonArray userRolesArray = profileJSON.object()["data"].toObject()["user"].toObject()["roles"].toArray();
|
||||||
|
|
||||||
QJsonArray allowedRolesArray = _settingsManager.getSettingsMap()
|
QStringList allowedRolesArray = _settingsManager.getSettingsMap().value(ALLOWED_ROLES_CONFIG_KEY).toStringList();
|
||||||
.value(ALLOWED_ROLES_CONFIG_KEY).toJsonValue().toArray();
|
|
||||||
|
|
||||||
QString connectableUsername;
|
QString connectableUsername;
|
||||||
QString profileUsername = profileJSON.object()["data"].toObject()["user"].toObject()["username"].toString();
|
QString profileUsername = profileJSON.object()["data"].toObject()["user"].toObject()["username"].toString();
|
||||||
|
|
||||||
foreach(const QJsonValue& roleValue, userRolesArray) {
|
foreach(const QJsonValue& roleValue, userRolesArray) {
|
||||||
if (allowedRolesArray.contains(roleValue)) {
|
if (allowedRolesArray.contains(roleValue.toString())) {
|
||||||
// the user has a role that lets them in
|
// the user has a role that lets them in
|
||||||
// set the bool to true and break
|
// set the bool to true and break
|
||||||
connectableUsername = profileUsername;
|
connectableUsername = profileUsername;
|
||||||
|
|
Loading…
Reference in a new issue