diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1d5108e198..793b9ea3eb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1475,11 +1475,7 @@ BOOL LLFolderBridge::isItemMovable() const LLInventoryObject* obj = getInventoryObject(); if(obj) { -// return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())); -// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0b) | Added: RLVa-1.3.0b - return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())) && - ((!rlv_handler_t::isEnabled()) || (!gRlvFolderLocks.isLockedFolder(obj->getUUID(), RLV_LOCK_ANY))); -// [/RLVa:KB] + return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())); } return FALSE; } @@ -1731,6 +1727,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g + if ( (is_movable) && (rlv_handler_t::isEnabled()) ) + { + is_movable = gRlvFolderLocks.canMove(cat_id, mUUID); + } +// [/RLVa:KB] + // //-------------------------------------------------------------------------------- diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ab6b0bb9ca..30a09c2a9d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -358,17 +358,13 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id) return FALSE; } - if (!model->isObjectDescendentOf(id, gInventory.getRootFolderID())) - { - return FALSE; - } - -// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0b) | Added: RLVa-1.3.0b - if ( (rlv_handler_t::isEnabled()) && (gRlvFolderLocks.isLockedFolder(id, RLV_LOCK_ANY)) ) - { - return FALSE; - } +// if (!model->isObjectDescendentOf(id, gInventory.getRootFolderID())) +// [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g + if ( (!model->isObjectDescendentOf(id, gInventory.getRootFolderID())) || ((rlv_handler_t::isEnabled()) && (!gRlvFolderLocks.canRemove(id))) ) // [/RLVa:KB] + { + return FALSE; + } if (!isAgentAvatarValid()) return FALSE; @@ -402,7 +398,7 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) { // if (!model) // [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g - if ( (!model) || ((rlv_handler_t::isEnabled()) && (model == &gInventory) && (gRlvFolderLocks.canRename(id))) ) + if ( (!model) || ((rlv_handler_t::isEnabled()) && (model == &gInventory) && (!gRlvFolderLocks.canRename(id))) ) // [/RLVa:KB] { return FALSE; diff --git a/indra/newview/rlvlocks.h b/indra/newview/rlvlocks.h index ba5623b320..2d170680cf 100644 --- a/indra/newview/rlvlocks.h +++ b/indra/newview/rlvlocks.h @@ -348,6 +348,8 @@ protected: * canXXX helper functions (note that a more approriate name might be userCanXXX) */ public: + bool canMove(const LLUUID& idFolder, const LLUUID& idDest = LLUUID::null) const; + bool canRemove(const LLUUID& idFolder) const; bool canRename(const LLUUID& idFolder) const; /* @@ -591,6 +593,20 @@ inline bool RlvFolderLocks::folderlock_descr_t::operator ==(const folderlock_des (eLockPermission == rhs.eLockPermission) && (eLockScope == rhs.eLockScope); } +// Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g +inline bool RlvFolderLocks::canMove(const LLUUID& idFolder, const LLUUID& idDest) const +{ + // Block moving a folder if the folder (or one of its descendents) is explicitly locked + return !hasLockedFolderDescendent(idFolder, ST_NONE, PERM_ANY, RLV_LOCK_ANY, true); +} + +// Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g +inline bool RlvFolderLocks::canRemove(const LLUUID& idFolder) const +{ + // Block removing a folder if the folder (or one of its descendents) is explicitly locked + return !hasLockedFolderDescendent(idFolder, ST_NONE, PERM_ANY, RLV_LOCK_ANY, true); +} + // Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g inline bool RlvFolderLocks::canRename(const LLUUID& idFolder) const {