mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:29:01 +02:00
More VS 2017/2015 fixes
This commit is contained in:
parent
b8ded015c6
commit
2837ae9183
2 changed files with 22 additions and 22 deletions
|
@ -246,10 +246,11 @@ void DomainServerSettingsManager::setupConfigMap(const QStringList& argumentList
|
||||||
_agentPermissions[editorKey]->set(NodePermissions::Permission::canAdjustLocks);
|
_agentPermissions[editorKey]->set(NodePermissions::Permission::canAdjustLocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QHash<NodePermissionsKey, NodePermissionsPointer>> permissionsSets;
|
QList<std::unordered_map<NodePermissionsKey, NodePermissionsPointer>> permissionsSets;
|
||||||
permissionsSets << _standardAgentPermissions.get() << _agentPermissions.get();
|
permissionsSets << _standardAgentPermissions.get() << _agentPermissions.get();
|
||||||
foreach (auto permissionsSet, permissionsSets) {
|
foreach (auto permissionsSet, permissionsSets) {
|
||||||
foreach (NodePermissionsKey userKey, permissionsSet.keys()) {
|
for (auto entry : permissionsSet) {
|
||||||
|
const auto& userKey = entry.first;
|
||||||
if (onlyEditorsAreRezzers) {
|
if (onlyEditorsAreRezzers) {
|
||||||
if (permissionsSet[userKey]->can(NodePermissions::Permission::canAdjustLocks)) {
|
if (permissionsSet[userKey]->can(NodePermissions::Permission::canAdjustLocks)) {
|
||||||
permissionsSet[userKey]->set(NodePermissions::Permission::canRezPermanentEntities);
|
permissionsSet[userKey]->set(NodePermissions::Permission::canRezPermanentEntities);
|
||||||
|
@ -1355,18 +1356,12 @@ QStringList DomainServerSettingsManager::getAllKnownGroupNames() {
|
||||||
// extract all the group names from the group-permissions and group-forbiddens settings
|
// extract all the group names from the group-permissions and group-forbiddens settings
|
||||||
QSet<QString> result;
|
QSet<QString> result;
|
||||||
|
|
||||||
QHashIterator<NodePermissionsKey, NodePermissionsPointer> i(_groupPermissions.get());
|
for (const auto& entry : _groupPermissions.get()) {
|
||||||
while (i.hasNext()) {
|
result += entry.first.first;
|
||||||
i.next();
|
|
||||||
NodePermissionsKey key = i.key();
|
|
||||||
result += key.first;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QHashIterator<NodePermissionsKey, NodePermissionsPointer> j(_groupForbiddens.get());
|
for (const auto& entry : _groupForbiddens.get()) {
|
||||||
while (j.hasNext()) {
|
result += entry.first.first;
|
||||||
j.next();
|
|
||||||
NodePermissionsKey key = j.key();
|
|
||||||
result += key.first;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.toList();
|
return result.toList();
|
||||||
|
@ -1377,20 +1372,17 @@ bool DomainServerSettingsManager::setGroupID(const QString& groupName, const QUu
|
||||||
_groupIDs[groupName.toLower()] = groupID;
|
_groupIDs[groupName.toLower()] = groupID;
|
||||||
_groupNames[groupID] = groupName;
|
_groupNames[groupID] = groupName;
|
||||||
|
|
||||||
QHashIterator<NodePermissionsKey, NodePermissionsPointer> i(_groupPermissions.get());
|
|
||||||
while (i.hasNext()) {
|
for (const auto& entry : _groupPermissions.get()) {
|
||||||
i.next();
|
auto& perms = entry.second;
|
||||||
NodePermissionsPointer perms = i.value();
|
|
||||||
if (perms->getID().toLower() == groupName.toLower() && !perms->isGroup()) {
|
if (perms->getID().toLower() == groupName.toLower() && !perms->isGroup()) {
|
||||||
changed = true;
|
changed = true;
|
||||||
perms->setGroupID(groupID);
|
perms->setGroupID(groupID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QHashIterator<NodePermissionsKey, NodePermissionsPointer> j(_groupForbiddens.get());
|
for (const auto& entry : _groupForbiddens.get()) {
|
||||||
while (j.hasNext()) {
|
auto& perms = entry.second;
|
||||||
j.next();
|
|
||||||
NodePermissionsPointer perms = j.value();
|
|
||||||
if (perms->getID().toLower() == groupName.toLower() && !perms->isGroup()) {
|
if (perms->getID().toLower() == groupName.toLower() && !perms->isGroup()) {
|
||||||
changed = true;
|
changed = true;
|
||||||
perms->setGroupID(groupID);
|
perms->setGroupID(groupID);
|
||||||
|
|
|
@ -132,8 +132,16 @@ public:
|
||||||
bool contains(const QString& keyFirst, const QUuid& keySecond) const {
|
bool contains(const QString& keyFirst, const QUuid& keySecond) const {
|
||||||
return 0 != _data.count(NodePermissionsKey(keyFirst.toLower(), keySecond));
|
return 0 != _data.count(NodePermissionsKey(keyFirst.toLower(), keySecond));
|
||||||
}
|
}
|
||||||
//QList<NodePermissionsKey> keys() const { return _data.keys(); }
|
|
||||||
std::unordered_map<NodePermissionsKey, NodePermissionsPointer> get() { return _data; }
|
QList<NodePermissionsKey> keys() const {
|
||||||
|
QList<NodePermissionsKey> result;
|
||||||
|
for (const auto& entry : _data) {
|
||||||
|
result.push_back(entry.first);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::unordered_map<NodePermissionsKey, NodePermissionsPointer>& get() { return _data; }
|
||||||
void clear() { _data.clear(); }
|
void clear() { _data.clear(); }
|
||||||
void remove(const NodePermissionsKey& key) { _data.erase(key); }
|
void remove(const NodePermissionsKey& key) { _data.erase(key); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue