mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
remove group-related debug prints
This commit is contained in:
parent
96fd1cb841
commit
6ec8aff645
2 changed files with 25 additions and 26 deletions
|
@ -126,26 +126,36 @@ NodePermissions DomainGatekeeper::applyPermissionsForUser(bool isLocalUser,
|
|||
|
||||
if (isLocalUser) {
|
||||
userPerms |= _server->_settingsManager.getStandardPermissionsForName(NodePermissions::standardNameLocalhost);
|
||||
qDebug() << "user-permissions: is local user, so:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: is local user, so:" << userPerms;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (verifiedUsername.isEmpty()) {
|
||||
userPerms |= _server->_settingsManager.getStandardPermissionsForName(NodePermissions::standardNameAnonymous);
|
||||
qDebug() << "user-permissions: unverified or no username, so:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: unverified or no username, so:" << userPerms;
|
||||
#endif
|
||||
} else {
|
||||
userPerms.setVerifiedUserName(verifiedUsername);
|
||||
if (_server->_settingsManager.havePermissionsForName(verifiedUsername)) {
|
||||
userPerms = _server->_settingsManager.getPermissionsForName(verifiedUsername);
|
||||
qDebug() << "user-permissions: specific user matches, so:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: specific user matches, so:" << userPerms;
|
||||
#endif
|
||||
} else {
|
||||
// they are logged into metaverse, but we don't have specific permissions for them.
|
||||
userPerms |= _server->_settingsManager.getStandardPermissionsForName(NodePermissions::standardNameLoggedIn);
|
||||
qDebug() << "user-permissions: user is logged-into metaverse, so:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: user is logged-into metaverse, so:" << userPerms;
|
||||
#endif
|
||||
|
||||
// if this user is a friend of the domain-owner, give them friend's permissions
|
||||
if (_domainOwnerFriends.contains(verifiedUsername)) {
|
||||
userPerms |= _server->_settingsManager.getStandardPermissionsForName(NodePermissions::standardNameFriends);
|
||||
qDebug() << "user-permissions: user is friends with domain-owner, so:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: user is friends with domain-owner, so:" << userPerms;
|
||||
#endif
|
||||
}
|
||||
|
||||
// if this user is a known member of a group, give them the implied permissions
|
||||
|
@ -155,13 +165,14 @@ NodePermissions DomainGatekeeper::applyPermissionsForUser(bool isLocalUser,
|
|||
userPerms |= _server->_settingsManager.getPermissionsForGroup(groupID, rankID);
|
||||
|
||||
GroupRank rank = _server->_settingsManager.getGroupRank(groupID, rankID);
|
||||
qDebug() << "user-permissions: user is in group:" << groupID << " rank:" << rank.name << "so:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: user is in group:" << groupID << " rank:"
|
||||
<< rank.name << "so:" << userPerms;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// if this user is a known member of a blacklist group, remove the implied permissions
|
||||
qDebug() << "------------------ checking blacklists ----------------------";
|
||||
qDebug() << _server->_settingsManager.getBlacklistGroupIDs();
|
||||
foreach (QUuid groupID, _server->_settingsManager.getBlacklistGroupIDs()) {
|
||||
QUuid rankID = _server->_settingsManager.isGroupMember(verifiedUsername, groupID);
|
||||
if (rankID != QUuid()) {
|
||||
|
@ -170,17 +181,19 @@ NodePermissions DomainGatekeeper::applyPermissionsForUser(bool isLocalUser,
|
|||
userPerms &= ~_server->_settingsManager.getForbiddensForGroup(groupID, rankID);
|
||||
|
||||
GroupRank rank = _server->_settingsManager.getGroupRank(groupID, rankID);
|
||||
qDebug() << "user-permissions: user is in blacklist group:" << groupID << " rank:" << rank.name
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: user is in blacklist group:" << groupID << " rank:" << rank.name
|
||||
<< "so:" << userPerms;
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
qDebug() << groupID << verifiedUsername << "is not member.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "user-permissions: final:" << userPerms;
|
||||
#ifdef WANT_DEBUG
|
||||
qDebug() << "| user-permissions: final:" << userPerms;
|
||||
#endif
|
||||
return userPerms;
|
||||
}
|
||||
|
||||
|
@ -781,12 +794,7 @@ void DomainGatekeeper::getIsGroupMemberJSONCallback(QNetworkReply& requestReply)
|
|||
// "status":"success"
|
||||
// }
|
||||
|
||||
|
||||
QJsonObject jsonObject = QJsonDocument::fromJson(requestReply.readAll()).object();
|
||||
|
||||
qDebug() << "********* getIsGroupMember api call returned:" << QJsonDocument(jsonObject).toJson(QJsonDocument::Compact);
|
||||
|
||||
|
||||
if (jsonObject["status"].toString() == "success") {
|
||||
QJsonObject data = jsonObject["data"].toObject();
|
||||
QJsonObject groups = data["groups"].toObject();
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
|
||||
#include "DomainServerSettingsManager.h"
|
||||
|
||||
#define WANT_DEBUG 1
|
||||
|
||||
|
||||
const QString SETTINGS_DESCRIPTION_RELATIVE_PATH = "/resources/describe-settings.json";
|
||||
|
||||
const QString DESCRIPTION_SETTINGS_KEY = "settings";
|
||||
|
@ -598,8 +595,6 @@ bool DomainServerSettingsManager::ensurePermissionsForGroupRanks() {
|
|||
}
|
||||
}
|
||||
|
||||
debugDumpGroupsState();
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
@ -764,10 +759,6 @@ bool DomainServerSettingsManager::handleAuthenticatedHTTPRequest(HTTPConnection
|
|||
rootObject[SETTINGS_RESPONSE_DESCRIPTION_KEY] = _descriptionArray;
|
||||
rootObject[SETTINGS_RESPONSE_VALUE_KEY] = responseObjectForType("", true);
|
||||
rootObject[SETTINGS_RESPONSE_LOCKED_VALUES_KEY] = QJsonDocument::fromVariant(_configMap.getMasterConfig()).object();
|
||||
|
||||
|
||||
qDebug() << QJsonDocument(rootObject).toJson(QJsonDocument::Indented);
|
||||
|
||||
connection->respond(HTTPConnection::StatusCode200, QJsonDocument(rootObject).toJson(), "application/json");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue