diff options
author | Dave Parks <davep@lindenlab.com> | 2022-10-12 14:47:19 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-10-12 14:47:19 -0500 |
commit | fad5ece612b36669add9babd6d4574d8a4974e70 (patch) | |
tree | 459476ba5f02ffd86e61ca40edeab35805e7717e | |
parent | 42ec639c860e172803753b9cb41ae9483305f2f8 (diff) | |
parent | 3514ab73bd30c70f8b730ee06e9ca08b48f8d3a2 (diff) |
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
-rw-r--r-- | indra/newview/llmaterialeditor.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 27b5d508e0..dfb43dfe0d 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -941,7 +941,27 @@ bool LLMaterialEditor::saveIfNeeded() create_inventory_item(gAgent.getID(), gAgent.getSessionID(), parent, tid, mMaterialName, res_desc, LLAssetType::AT_MATERIAL, LLInventoryType::IT_MATERIAL, subtype, next_owner_perm, - new LLBoostFuncInventoryCallback([output = buffer](LLUUID const& inv_item_id) { + new LLBoostFuncInventoryCallback([output = buffer](LLUUID const& inv_item_id) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item_id); + if (item) + { + // create_inventory_item doesn't allow presetting some permissions, fix it now + LLPermissions perm = item->getPermissions(); + if (perm.getMaskEveryone() != LLFloaterPerms::getEveryonePerms("Uploads") + || perm.getMaskGroup() != LLFloaterPerms::getGroupPerms("Uploads")) + { + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Uploads")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Uploads")); + + item->setPermissions(perm); + + item->updateServer(FALSE); + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + } + // from reference in LLSettingsVOBase::createInventoryItem()/updateInventoryItem() LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>( @@ -966,7 +986,7 @@ bool LLMaterialEditor::saveIfNeeded() } LLViewerAssetUpload::EnqueueInventoryUpload(agent_url, uploadInfo); } - }) + }) ); // We do not update floater with uploaded asset yet, so just close it. |