summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepaneliteminfo.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2017-04-20 19:01:28 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2017-04-20 19:01:28 +0300
commit0c1d229f39d3305eafa5071e2a22c9c806280b3b (patch)
treebf91c8d1219b20a513a6f17ea70a68e477ea1d73 /indra/newview/llsidepaneliteminfo.cpp
parent21babcf3e1925c4a8eed9e46cb9a2bfacbfb7458 (diff)
MAINT-1463 Fixed inconsistent permissions
Permissions should be checked against owning group instead of active one
Diffstat (limited to 'indra/newview/llsidepaneliteminfo.cpp')
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp19
1 files changed, 14 insertions, 5 deletions
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<LLCheckBoxCtrl>("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<LLCheckBoxCtrl>("CheckEveryoneCopy");
if(CheckEveryoneCopy)
{
- perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
+ perm.setEveryoneBits(gAgent.getID(), group_id,
CheckEveryoneCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckNextOwnerModify = getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
if(CheckNextOwnerModify)
{
- perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
+ perm.setNextOwnerBits(gAgent.getID(), group_id,
CheckNextOwnerModify->get(), PERM_MODIFY);
}
LLCheckBoxCtrl* CheckNextOwnerCopy = getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
if(CheckNextOwnerCopy)
{
- perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
+ perm.setNextOwnerBits(gAgent.getID(), group_id,
CheckNextOwnerCopy->get(), PERM_COPY);
}
LLCheckBoxCtrl* CheckNextOwnerTransfer = getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
if(CheckNextOwnerTransfer)
{
- perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
+ perm.setNextOwnerBits(gAgent.getID(), group_id,
CheckNextOwnerTransfer->get(), PERM_TRANSFER);
}
if(perm != item->getPermissions()