aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-04-19 21:02:36 +0100
committerJustin Clark-Casey (justincc)2010-04-19 21:02:36 +0100
commitda83ee28be93ff2649e1df214d942b01104247de (patch)
tree9419de09d3ce61f92e2ad871543965717badf5da /OpenSim/Region/ClientStack
parentlog problems when an asset request through the UDP TransferRequest channel go... (diff)
downloadopensim-SC-da83ee28be93ff2649e1df214d942b01104247de.zip
opensim-SC-da83ee28be93ff2649e1df214d942b01104247de.tar.gz
opensim-SC-da83ee28be93ff2649e1df214d942b01104247de.tar.bz2
opensim-SC-da83ee28be93ff2649e1df214d942b01104247de.tar.xz
If a transfer request is received for a task inventory item asset, then route the permissions request through the existing CanEditScript() and CanEditNotecard() methods.
This implements the 'share with group' flag for notecards and scripts in prim inventory since the PermissionsModule checks group membership and permissions. Other than that, the code in PermissionsModule duplicates the checks in LLClientView so there should be no change other than allowing group members to edit embedded notecards and scripts. For all other asset types, the permission checking code in LLClientView continues to be used, pending refactoring of suitable permissions code This means that 'share with group' will not yet work for prim inventory items other than notecards and scripts
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs108
1 files changed, 64 insertions, 44 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 54c312c..c4e8e09 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -7093,7 +7093,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7093 UUID requestID = new UUID(transfer.TransferInfo.Params, 80); 7093 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7094 7094
7095// m_log.DebugFormat( 7095// m_log.DebugFormat(
7096// "[LLCLIENTVIEW]: Got request for asset {0} from item {1} in prim {2} by {3}", 7096// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
7097// requestID, itemID, taskID, Name); 7097// requestID, itemID, taskID, Name);
7098 7098
7099 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7099 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
@@ -7105,60 +7105,75 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7105 if (part == null) 7105 if (part == null)
7106 { 7106 {
7107 m_log.WarnFormat( 7107 m_log.WarnFormat(
7108 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist", 7108 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7109 Name, requestID, itemID, taskID); 7109 Name, requestID, itemID, taskID);
7110 return true; 7110 return true;
7111 } 7111 }
7112 7112
7113 if (part.OwnerID != AgentId) 7113 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
7114 if (tii == null)
7114 { 7115 {
7115 m_log.WarnFormat( 7116 m_log.WarnFormat(
7116 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}", 7117 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7117 Name, requestID, itemID, taskID, part.OwnerID);
7118 return true;
7119 }
7120
7121 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7122 {
7123 m_log.WarnFormat(
7124 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7125 Name, requestID, itemID, taskID);
7126 return true;
7127 }
7128
7129 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
7130 if (ti == null)
7131 {
7132 m_log.WarnFormat(
7133 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7134 Name, requestID, itemID, taskID); 7118 Name, requestID, itemID, taskID);
7135 return true; 7119 return true;
7136 } 7120 }
7137 7121
7138 if (ti.OwnerID != AgentId) 7122 if (tii.Type == (int)AssetType.LSLText)
7139 { 7123 {
7140 m_log.WarnFormat( 7124 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
7141 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}", 7125 return true;
7142 Name, requestID, itemID, taskID, ti.OwnerID);
7143 return true;
7144 } 7126 }
7145 7127 else if (tii.Type == (int)AssetType.Notecard)
7146 if ((
7147 ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7148 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7149 { 7128 {
7150 m_log.WarnFormat( 7129 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7151 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer", 7130 return true;
7152 Name, requestID, itemID, taskID);
7153 return true;
7154 } 7131 }
7155 7132 else
7156 if (ti.AssetID != requestID)
7157 { 7133 {
7158 m_log.WarnFormat( 7134 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7159 "[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}", 7135 // shared with group. In fact, all this permissions checking should move to an IPermissionsModule
7160 Name, requestID, itemID, taskID, ti.AssetID); 7136 if (part.OwnerID != AgentId)
7161 return true; 7137 {
7138 m_log.WarnFormat(
7139 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7140 Name, requestID, itemID, taskID, part.OwnerID);
7141 return true;
7142 }
7143
7144 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7145 {
7146 m_log.WarnFormat(
7147 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7148 Name, requestID, itemID, taskID);
7149 return true;
7150 }
7151
7152 if (tii.OwnerID != AgentId)
7153 {
7154 m_log.WarnFormat(
7155 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
7156 Name, requestID, itemID, taskID, tii.OwnerID);
7157 return true;
7158 }
7159
7160 if ((
7161 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7162 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7163 {
7164 m_log.WarnFormat(
7165 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
7166 Name, requestID, itemID, taskID);
7167 return true;
7168 }
7169
7170 if (tii.AssetID != requestID)
7171 {
7172 m_log.WarnFormat(
7173 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
7174 Name, requestID, itemID, taskID, tii.AssetID);
7175 return true;
7176 }
7162 } 7177 }
7163 } 7178 }
7164 else // Agent 7179 else // Agent
@@ -7197,7 +7212,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7197 } 7212 }
7198 7213
7199 if (assetRequestItem.AssetID != requestID) 7214 if (assetRequestItem.AssetID != requestID)
7215 {
7216 m_log.WarnFormat(
7217 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
7218 Name, requestID, itemID, assetRequestItem.AssetID);
7200 return true; 7219 return true;
7220 }
7201 } 7221 }
7202 } 7222 }
7203 } 7223 }
@@ -11432,7 +11452,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11432 // } 11452 // }
11433 } 11453 }
11434 11454
11435// m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID); 11455// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
11436 11456
11437 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 11457 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
11438 } 11458 }
@@ -11800,4 +11820,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11800 OutPacket(dialog, ThrottleOutPacketType.Task); 11820 OutPacket(dialog, ThrottleOutPacketType.Task);
11801 } 11821 }
11802 } 11822 }
11803} 11823} \ No newline at end of file