diff options
| author | Rider Linden <rider@lindenlab.com> | 2026-08-26 12:18:27 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2026-08-26 12:18:27 -0700 |
| commit | 71548bcc9ccbc0f94d9f1f47b710ff7a351a05d3 (patch) | |
| tree | 16c17251f0218248dc0da3f9c563677337dbd5df /indra/newview/llpublishedobjectmgr.cpp | |
| parent | 47edf30eaa81b47a57f2a0a289947912b5a1da2f (diff) | |
Cleanup from second set of fixes.
Diffstat (limited to 'indra/newview/llpublishedobjectmgr.cpp')
| -rw-r--r-- | indra/newview/llpublishedobjectmgr.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/indra/newview/llpublishedobjectmgr.cpp b/indra/newview/llpublishedobjectmgr.cpp index 5c9c080b5d..c11a45a3b1 100644 --- a/indra/newview/llpublishedobjectmgr.cpp +++ b/indra/newview/llpublishedobjectmgr.cpp @@ -88,6 +88,23 @@ namespace // Never emit an empty prim/object name to downstream tooling. return obj->getID().asString(); } + + void add_object_permissions(LLSD& object_data, LLViewerObject* object) + { + LLPermissions* permissions = + LLSelectMgr::getInstance()->findObjectPermissions(object); + if (!permissions) + { + return; + } + + LLSD permission_entry; + permission_entry["owner"] = + static_cast<S32>(permissions->getMaskOwner()); + permission_entry["next_owner"] = + static_cast<S32>(permissions->getMaskNextOwner()); + object_data["permissions"] = permission_entry; + } } class LLPublishedPrimListener : public LLVOInventoryListener @@ -729,11 +746,7 @@ LLSD LLPublishedObjectMgr::buildPublishedObjectLLSD(LLViewerObject* root) const { LL_PROFILE_ZONE_SCOPED_CATEGORY_SCRIPTDEV; LLSD pub; - const LLPermissions& root_perms = root->getPermissions(); - LLSD root_perm_entry; - root_perm_entry["owner"] = static_cast<S32>(root_perms.getMaskOwner()); - root_perm_entry["next_owner"] = static_cast<S32>(root_perms.getMaskNextOwner()); - pub["permissions"] = root_perm_entry; + add_object_permissions(pub, root); pub["object_id"] = root->getID(); pub["object_name"] = get_prim_name(root); pub["object_description"] = nv_string(root, "Desc"); @@ -758,11 +771,7 @@ LLSD LLPublishedObjectMgr::buildPublishedObjectLLSD(LLViewerObject* root) const link["link_number"] = link_number++; link["link_name"] = get_prim_name(child); link["link_description"] = nv_string(child, "Desc"); - const LLPermissions& child_perms = child->getPermissions(); - LLSD child_perm_entry; - child_perm_entry["owner"] = static_cast<S32>(child_perms.getMaskOwner()); - child_perm_entry["next_owner"] = static_cast<S32>(child_perms.getMaskNextOwner()); - link["permissions"] = child_perm_entry; + add_object_permissions(link, child); link["inventory"] = buildPrimInventoryLLSD(child); linked_objects.append(link); } @@ -788,11 +797,7 @@ LLSD LLPublishedObjectMgr::buildObjectListLLSD() const } LLSD pub; - const LLPermissions& root_perms = root->getPermissions(); - LLSD root_perm_entry; - root_perm_entry["owner"] = static_cast<S32>(root_perms.getMaskOwner()); - root_perm_entry["next_owner"] = static_cast<S32>(root_perms.getMaskNextOwner()); - pub["permissions"] = root_perm_entry; + add_object_permissions(pub, root); pub["object_id"] = info.mObjectID; pub["object_name"] = info.mObjectName; pub["object_description"] = info.mObjectDescription; @@ -823,11 +828,7 @@ LLSD LLPublishedObjectMgr::buildObjectListLLSD() const link["link_number"] = prim_info.mLinkNumber; link["link_name"] = prim_info.mPrimName; link["link_description"] = prim_info.mPrimDescription; - const LLPermissions& child_perms = child->getPermissions(); - LLSD child_perm_entry; - child_perm_entry["owner"] = static_cast<S32>(child_perms.getMaskOwner()); - child_perm_entry["next_owner"] = static_cast<S32>(child_perms.getMaskNextOwner()); - link["permissions"] = child_perm_entry; + add_object_permissions(link, child); link["inventory"] = buildPrimInventoryLLSD(child); linked_objects.append(link); } |
