aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
diff options
context:
space:
mode:
authorDiva Canto2010-07-04 13:56:03 -0700
committerDiva Canto2010-07-04 13:56:03 -0700
commit02a15bc787b2cc6784c9626e041a4365ec362194 (patch)
treeae50c7d544052b51fc50f364832492b6d9160165 /OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
parentFixes the obvious problem in mantis #4841. Melanie needs to look at other pot... (diff)
downloadopensim-SC_OLD-02a15bc787b2cc6784c9626e041a4365ec362194.zip
opensim-SC_OLD-02a15bc787b2cc6784c9626e041a4365ec362194.tar.gz
opensim-SC_OLD-02a15bc787b2cc6784c9626e041a4365ec362194.tar.bz2
opensim-SC_OLD-02a15bc787b2cc6784c9626e041a4365ec362194.tar.xz
Started to clean up the mess with HyperAssets in LLClientView. Fixed HG access to Notecards in user's inventory.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 12b6aa0..39616f7 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -639,6 +639,50 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
639 { 639 {
640 } 640 }
641 641
642 public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
643 {
644 InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
645 if (assetRequestItem == null)
646 {
647 ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
648 if (lib != null)
649 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
650 if (assetRequestItem == null)
651 return false;
652 }
653
654 // At this point, we need to apply perms
655 // only to notecards and scripts. All
656 // other asset types are always available
657 //
658 if (assetRequestItem.AssetType == (int)AssetType.LSLText)
659 {
660 if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId))
661 {
662 remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false);
663 return false;
664 }
665 }
666 else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
667 {
668 if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId))
669 {
670 remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false);
671 return false;
672 }
673 }
674
675 if (assetRequestItem.AssetID != requestID)
676 {
677 m_log.WarnFormat(
678 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
679 Name, requestID, itemID, assetRequestItem.AssetID);
680 return false;
681 }
682
683 return true;
684 }
685
642 #endregion 686 #endregion
643 687
644 #region Misc 688 #region Misc
@@ -661,6 +705,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
661 return asset; 705 return asset;
662 } 706 }
663 707
708 protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID)
709 {
710 IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>();
711 InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID);
712 assetRequestItem = invService.GetItem(assetRequestItem);
713 return assetRequestItem;
714 }
715
664 #endregion 716 #endregion
665 } 717 }
666} 718}