diff options
author | Merov Linden <merov@lindenlab.com> | 2014-04-03 16:23:01 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-04-03 16:23:01 -0700 |
commit | 0f944702298cc4e7c62b117d5bba1b8cd788a73d (patch) | |
tree | 29bfc063191778596076ffc2754e0b333907da78 /indra/newview/llinventoryfunctions.cpp | |
parent | 39659f3c034c5cb335e185d1411e808d272f8065 (diff) |
DD-24 : Fix the tests that decide what is resalable and what is a stock item
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index aef05fead5..d99193067d 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -730,10 +730,9 @@ void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); viewer_inv_item = (linked_item != NULL ? linked_item : viewer_inv_item); - // Check that the agent has copy permission on the item: this is required as a resident cannot - // put on sale items she has no right about. Proceed with move if we have permission. - // *TODO : Check that this is adequate (copied from the Merchant Outbox permission check so should be OK...) - if (viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + // Check that the agent has transfer permission on the item: this is required as a resident cannot + // put on sale items she cannot transfer. Proceed with move if we have permission. + if (viewer_inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID(), gAgent.getGroupID())) { // When moving an isolated item directly under the marketplace listings root, we create a new folder with that name if (dest_folder == marketplace_listings_uuid) @@ -743,7 +742,7 @@ void move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol LLViewerInventoryCategory* dest_cat = gInventory.getCategory(dest_folder); // When moving a no copy item into a first level listing folder, we create a stock folder for it - if (!(viewer_inv_item->getPermissions().getMaskEveryone() & PERM_COPY) && (dest_cat->getParentUUID() == marketplace_listings_uuid)) + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()) && (dest_cat->getParentUUID() == marketplace_listings_uuid)) { dest_folder = create_folder_for_item(inv_item, dest_folder); } @@ -842,8 +841,9 @@ bool has_correct_permissions_for_sale(LLInventoryCategory* cat) llinfos << "Merov : linked items in this folder -> not allowed to sell!" << llendl; return false; } - // *TODO : Check that this is adequate (copied from the Merchant Outbox permission check so should be OK...) - if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + // Check that the agent has transfer permission on the item: this is required as a resident cannot + // put on sale items she cannot transfer. Proceed with move if we have permission. + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID(), gAgent.getGroupID())) { llinfos << "Merov : wrong permissions on items in this folder -> not allowed to sell!" << llendl; return false; @@ -891,11 +891,11 @@ void validate_marketplacelistings(LLInventoryCategory* cat) { llinfos << "Merov : Validation error: there are linked items in this listing!" << llendl; } - if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID(), gAgent.getGroupID())) { llinfos << "Merov : Validation error: there are items with incorrect permissions in this listing!" << llendl; } - if (!(viewer_inv_item->getPermissions().getMaskEveryone() & PERM_COPY) && (folder_type != LLFolderType::FT_MARKETPLACE_STOCK)) + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()) && (folder_type != LLFolderType::FT_MARKETPLACE_STOCK)) { llinfos << "Merov : Validation warning : no copy item found in non stock folder -> reparent to relevant stock folder!" << llendl; if (stock_folder_uuid.isNull()) |