Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -487,6 +487,15 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr · 486 unmodified lines | ||
| 487 | 487 | |
| 488 | 488 | _activityTracking.addedEntityCount++; |
| 489 | 489 | |
| 490 | + auto nodeList = DependencyManager::get<NodeList>(); | |
| 491 | + | |
| 492 | + if (entityHostType == entity::HostType::AVATAR && !nodeList->getThisNodeCanRezAvatarEntities()) { | |
| 493 | + qCDebug(entities) << "Ignoring addEntity() because don't have canRezAvatarEntities permission on domain"; | |
| 494 | + // Only need to intercept methods that may add an avatar entity because avatar entities are removed from the tree when | |
| 495 | + // user doesn't have canRezAvatarEntities permission. | |
| 496 | + return QUuid(); | |
| 497 | + } | |
| 498 | + | |
| 490 | 499 | EntityItemProperties propertiesWithSimID = properties; |
| 491 | 500 | propertiesWithSimID.setEntityHostType(entityHostType); |
| 492 | 501 | if (entityHostType == entity::HostType::AVATAR) { |
| @@ -499,7 +508,6 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr · 6 unmodified lines | ||
| 499 | 508 | } |
| 500 | 509 | |
| 501 | 510 | // the created time will be set in EntityTree::addEntity by recordCreationTime() |
| 502 | − auto nodeList = DependencyManager::get<NodeList>(); | |
| 503 | 511 | auto sessionID = nodeList->getSessionUUID(); |
| 504 | 512 | propertiesWithSimID.setLastEditedBy(sessionID); |
| 505 | 513 | |