mirror of
https://github.com/overte-org/overte.git
synced 2025-04-10 03:22:32 +02:00
Ignore Entities.addEntity() for avatar entities if don't have permission
This commit is contained in:
parent
0adfd8b806
commit
e23251df4e
1 changed files with 9 additions and 1 deletions
|
@ -487,6 +487,15 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr
|
|||
|
||||
_activityTracking.addedEntityCount++;
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
if (entityHostType == entity::HostType::AVATAR && !nodeList->getThisNodeCanRezAvatarEntities()) {
|
||||
qCDebug(entities) << "Ignoring addEntity() because don't have canRezAvatarEntities permission on domain";
|
||||
// Only need to intercept methods that may add an avatar entity because avatar entities are removed from the tree when
|
||||
// user doesn't have canRezAvatarEntities permission.
|
||||
return QUuid();
|
||||
}
|
||||
|
||||
EntityItemProperties propertiesWithSimID = properties;
|
||||
propertiesWithSimID.setEntityHostType(entityHostType);
|
||||
if (entityHostType == entity::HostType::AVATAR) {
|
||||
|
@ -499,7 +508,6 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr
|
|||
}
|
||||
|
||||
// the created time will be set in EntityTree::addEntity by recordCreationTime()
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
auto sessionID = nodeList->getSessionUUID();
|
||||
propertiesWithSimID.setLastEditedBy(sessionID);
|
||||
|
||||
|
|
Loading…
Reference in a new issue