aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-23 03:36:16 +0000
committerMelanie Thielker2008-09-23 03:36:16 +0000
commit70d264ee6cfae6cfe90d38460c4087b9956dab6c (patch)
tree2261f8969fb30b7d88bf2cb72fe5ec0ba435bcef /OpenSim/Region/Environment/Scenes
parent* Update in OGP draft 3 protocol spec with regards to seed region requests ru... (diff)
downloadopensim-SC_OLD-70d264ee6cfae6cfe90d38460c4087b9956dab6c.zip
opensim-SC_OLD-70d264ee6cfae6cfe90d38460c4087b9956dab6c.tar.gz
opensim-SC_OLD-70d264ee6cfae6cfe90d38460c4087b9956dab6c.tar.bz2
opensim-SC_OLD-70d264ee6cfae6cfe90d38460c4087b9956dab6c.tar.xz
Update the permissions system to handle scripts and notecards the way
it was meant to. No functional changes, just better code
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs32
1 files changed, 23 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index a1c5fe7..c1c1b6e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -171,6 +171,23 @@ namespace OpenSim.Region.Environment.Scenes
171 171
172 if (item != null) 172 if (item != null)
173 { 173 {
174 if ((InventoryType) item.InvType == InventoryType.Notecard)
175 {
176 if (!ExternalChecks.ExternalChecksCanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId))
177 {
178 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
179 return UUID.Zero;
180 }
181 }
182 else if ((InventoryType) item.InvType == InventoryType.LSL)
183 {
184 if (!ExternalChecks.ExternalChecksCanEditScript(itemID, UUID.Zero, remoteClient.AgentId))
185 {
186 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
187 return UUID.Zero;
188 }
189 }
190
174 AssetBase asset = 191 AssetBase asset =
175 CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); 192 CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data);
176 AssetCache.AddAsset(asset); 193 AssetCache.AddAsset(asset);
@@ -179,15 +196,6 @@ namespace OpenSim.Region.Environment.Scenes
179 userInfo.UpdateItem(item); 196 userInfo.UpdateItem(item);
180 197
181 // remoteClient.SendInventoryItemCreateUpdate(item); 198 // remoteClient.SendInventoryItemCreateUpdate(item);
182 if ((InventoryType) item.InvType == InventoryType.Notecard)
183 {
184 //do we want to know about updated note cards?
185 }
186 else if ((InventoryType) item.InvType == InventoryType.LSL)
187 {
188 // do we want to know about updated scripts
189 }
190
191 return (asset.FullID); 199 return (asset.FullID);
192 } 200 }
193 } 201 }
@@ -228,6 +236,12 @@ namespace OpenSim.Region.Environment.Scenes
228 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, 236 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId,
229 UUID primId, bool isScriptRunning, byte[] data) 237 UUID primId, bool isScriptRunning, byte[] data)
230 { 238 {
239 if (!ExternalChecks.ExternalChecksCanEditScript(itemId, primId, remoteClient.AgentId))
240 {
241 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
242 return;
243 }
244
231 // Retrieve group 245 // Retrieve group
232 SceneObjectPart part = GetSceneObjectPart(primId); 246 SceneObjectPart part = GetSceneObjectPart(primId);
233 SceneObjectGroup group = part.ParentGroup; 247 SceneObjectGroup group = part.ParentGroup;