diff options
| author | andreykproductengine <akleshchev@productengine.com> | 2016-04-22 18:41:45 +0300 |
|---|---|---|
| committer | andreykproductengine <akleshchev@productengine.com> | 2016-04-22 18:41:45 +0300 |
| commit | e302b6f1f451f8a2388698b3528fb71af9cf41b2 (patch) | |
| tree | 3c60c9d670c0297e0ba0dde146d64e4d8b5563b4 /indra/newview/llpreviewnotecard.cpp | |
| parent | bb719baec5b3000d0e9671283f5b5e9f23e780ac (diff) | |
MAINT-2063 Fixed User had ability to delete Notecards and textures from library
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
| -rwxr-xr-x | indra/newview/llpreviewnotecard.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 20c43bc432..ba9845ef04 100755 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -94,7 +94,8 @@ BOOL LLPreviewNotecard::postBuild() if (item) { getChild<LLUICtrl>("desc")->setValue(item->getDescription()); - getChildView("Delete")->setEnabled(true); + BOOL source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(item->getUUID(), gInventory.getLibraryRootFolderID()); + getChildView("Delete")->setEnabled(!source_library); } getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); @@ -219,6 +220,7 @@ void LLPreviewNotecard::loadAsset() BOOL is_owner = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); BOOL allow_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); BOOL allow_modify = canModify(mObjectUUID, item); + BOOL source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(mItemUUID, gInventory.getLibraryRootFolderID()); if (allow_copy || gAgent.isGodlike()) { @@ -288,7 +290,7 @@ void LLPreviewNotecard::loadAsset() getChildView("lock")->setVisible( TRUE); } - if(allow_modify || is_owner) + if((allow_modify || is_owner) && !source_library) { getChildView("Delete")->setEnabled(TRUE); } |
