From 0c1d229f39d3305eafa5071e2a22c9c806280b3b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 20 Apr 2017 19:01:28 +0300 Subject: MAINT-1463 Fixed inconsistent permissions Permissions should be checked against owning group instead of active one --- indra/newview/llsidepaneliteminfo.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview/llsidepaneliteminfo.cpp') diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 3c58dd7194..43e7e57814 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -815,40 +815,49 @@ void LLSidepanelItemInfo::onCommitPermissions() //LL_INFOS() << "LLSidepanelItemInfo::onCommitPermissions()" << LL_ENDL; LLViewerInventoryItem* item = findItem(); if(!item) return; + + BOOL is_group_owned; + LLUUID owner_id; + LLUUID group_id; LLPermissions perm(item->getPermissions()); + perm.getOwnership(owner_id, is_group_owned); + if (is_group_owned && gAgent.hasPowerInGroup(owner_id, GP_OBJECT_MANIPULATE)) + { + group_id = owner_id; + } LLCheckBoxCtrl* CheckShareWithGroup = getChild("CheckShareWithGroup"); if(CheckShareWithGroup) { - perm.setGroupBits(gAgent.getID(), gAgent.getGroupID(), + perm.setGroupBits(gAgent.getID(), group_id, CheckShareWithGroup->get(), PERM_MODIFY | PERM_MOVE | PERM_COPY); } LLCheckBoxCtrl* CheckEveryoneCopy = getChild("CheckEveryoneCopy"); if(CheckEveryoneCopy) { - perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), + perm.setEveryoneBits(gAgent.getID(), group_id, CheckEveryoneCopy->get(), PERM_COPY); } LLCheckBoxCtrl* CheckNextOwnerModify = getChild("CheckNextOwnerModify"); if(CheckNextOwnerModify) { - perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), + perm.setNextOwnerBits(gAgent.getID(), group_id, CheckNextOwnerModify->get(), PERM_MODIFY); } LLCheckBoxCtrl* CheckNextOwnerCopy = getChild("CheckNextOwnerCopy"); if(CheckNextOwnerCopy) { - perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), + perm.setNextOwnerBits(gAgent.getID(), group_id, CheckNextOwnerCopy->get(), PERM_COPY); } LLCheckBoxCtrl* CheckNextOwnerTransfer = getChild("CheckNextOwnerTransfer"); if(CheckNextOwnerTransfer) { - perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), + perm.setNextOwnerBits(gAgent.getID(), group_id, CheckNextOwnerTransfer->get(), PERM_TRANSFER); } if(perm != item->getPermissions() -- cgit v1.2.3