From fbb4e5fb0f7bba935ec9d0d466be12a346a6b149 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 8 Jun 2012 13:49:02 -0400 Subject: STORM-68 As a Builder, I want that ability to set default permissions on creation of objects, clothing, scripts, notecards, etc. First pass at implementation, debuggins lines still need to be removed and there is one known bug to be resolved. --- indra/newview/llviewerobject.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index cd300accb7..98856d125f 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -100,6 +100,7 @@ #include "lltrans.h" #include "llsdutil.h" #include "llmediaentry.h" +#include "llfloaterperms.h" //#define DEBUG_UPDATE_TYPE @@ -2571,8 +2572,15 @@ void LLViewerObject::saveScript( * interaction with doUpdateInventory() called below. */ lldebugs << "LLViewerObject::saveScript() " << item->getUUID() << " " << item->getAssetUUID() << llendl; + + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Scripts")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts")); + perm.setMaskNext(PERM_ALL); + LLPointer task_item = - new LLViewerInventoryItem(item->getUUID(), mID, item->getPermissions(), + new LLViewerInventoryItem(item->getUUID(), mID, perm, item->getAssetUUID(), item->getType(), item->getInventoryType(), item->getName(), item->getDescription(), @@ -2594,6 +2602,8 @@ void LLViewerObject::saveScript( task_item->packMessage(msg); msg->sendReliable(mRegionp->getHost()); + task_item->setPermissions(perm); + // do the internal logic doUpdateInventory(task_item, TASK_INVENTORY_ITEM_KEY, is_new); } -- cgit v1.2.3 From d61a5f743c5d3bde0146b036508485bfdc9c3cb5 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 9 Jun 2012 10:05:54 -0400 Subject: STORM-68 Removed debugging PERM_ALL that was causing upload trouble and removed 3 obsolete debug settings --- indra/newview/llviewerobject.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 98856d125f..a494e934b0 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2577,7 +2577,6 @@ void LLViewerObject::saveScript( perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Scripts")); perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts")); perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts")); - perm.setMaskNext(PERM_ALL); LLPointer task_item = new LLViewerInventoryItem(item->getUUID(), mID, perm, @@ -2602,10 +2601,10 @@ void LLViewerObject::saveScript( task_item->packMessage(msg); msg->sendReliable(mRegionp->getHost()); - task_item->setPermissions(perm); - // do the internal logic doUpdateInventory(task_item, TASK_INVENTORY_ITEM_KEY, is_new); +llwarns << "DBG is_new:" << is_new << llendl; + task_item->setPermissions(perm); } void LLViewerObject::moveInventory(const LLUUID& folder_id, -- cgit v1.2.3 From b6df9b6d56108bcf4b3e8dfd875ef76a9b6f448b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 9 Jun 2012 11:43:39 -0400 Subject: STORM-68 Fiddling with debugging for New Script case --- indra/newview/llviewerobject.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a494e934b0..57549e025c 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2555,6 +2555,17 @@ void LLViewerObject::doUpdateInventory( doInventoryCallback(); ++mInventorySerialNum; } + + if(is_new && mInventory) + { + std::string name = item->getName(); +llwarns << "DBG " << name << llendl; + LLPermissions perm = item->getPermissions(); + perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Scripts")); + perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts")); + perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts")); + item->setPermissions(perm); + } } // save a script, which involves removing the old one, and rezzing @@ -2573,13 +2584,8 @@ void LLViewerObject::saveScript( */ lldebugs << "LLViewerObject::saveScript() " << item->getUUID() << " " << item->getAssetUUID() << llendl; - LLPermissions perm = item->getPermissions(); - perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Scripts")); - perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts")); - perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts")); - LLPointer task_item = - new LLViewerInventoryItem(item->getUUID(), mID, perm, + new LLViewerInventoryItem(item->getUUID(), mID, item->getPermissions(), item->getAssetUUID(), item->getType(), item->getInventoryType(), item->getName(), item->getDescription(), @@ -2603,8 +2609,6 @@ void LLViewerObject::saveScript( // do the internal logic doUpdateInventory(task_item, TASK_INVENTORY_ITEM_KEY, is_new); -llwarns << "DBG is_new:" << is_new << llendl; - task_item->setPermissions(perm); } void LLViewerObject::moveInventory(const LLUUID& folder_id, -- cgit v1.2.3 From 052dc3982056d822a523394954c277d9eb7c7ab9 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 12 Jun 2012 14:26:53 -0400 Subject: STORM-68 Fix for group perms not being defined correctly and fix for group and everyone perms failing to copy and paste --- indra/newview/llviewerobject.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 57549e025c..ff714f24b4 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2555,17 +2555,6 @@ void LLViewerObject::doUpdateInventory( doInventoryCallback(); ++mInventorySerialNum; } - - if(is_new && mInventory) - { - std::string name = item->getName(); -llwarns << "DBG " << name << llendl; - LLPermissions perm = item->getPermissions(); - perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Scripts")); - perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts")); - perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts")); - item->setPermissions(perm); - } } // save a script, which involves removing the old one, and rezzing -- cgit v1.2.3