summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-07-02 20:09:36 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-07-02 20:09:36 +0300
commit5346e7909ff6d462ee3c28504030b33b3e497d0f (patch)
tree7c7365a47779343b2a5fcbcf016e981fae8852fb
parent41c0a95365428a8486c37a9c175acc29653d9639 (diff)
MAINT-8618 Viewer attempting to edit action when it has no permission
-rw-r--r--indra/newview/llpanelpermissions.cpp39
1 files changed, 25 insertions, 14 deletions
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index fc44ce340c..ef16427713 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -1210,23 +1210,34 @@ void LLPanelPermissions::setAllSaleInfo()
LLSaleInfo new_sale_info(sale_type, price);
LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info);
- struct f : public LLSelectedObjectFunctor
+ // Note: won't work right if a root and non-root are both single-selected (here and other places).
+ BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
+ && LLSelectMgr::getInstance()->selectGetRootsModify())
+ || LLSelectMgr::getInstance()->selectGetModify();
+ BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
+ && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
+ || LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
+
+ if (is_perm_modify && is_nonpermanent_enforced)
{
- virtual bool apply(LLViewerObject* object)
+ struct f : public LLSelectedObjectFunctor
{
- return object->getClickAction() == CLICK_ACTION_BUY
- || object->getClickAction() == CLICK_ACTION_TOUCH;
+ virtual bool apply(LLViewerObject* object)
+ {
+ return object->getClickAction() == CLICK_ACTION_BUY
+ || object->getClickAction() == CLICK_ACTION_TOUCH;
+ }
+ } check_actions;
+
+ // Selection should only contain objects that are of target
+ // action already or of action we are aiming to remove.
+ bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions);
+
+ if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale())
+ {
+ U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH;
+ LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action);
}
- } check_actions;
-
- // Selection should only contain objects that are of target
- // action already or of action we are aiming to remove.
- bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions);
-
- if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale())
- {
- U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH;
- LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action);
}
}