aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-07 07:42:03 +0000
committerTeravus Ovares2007-12-07 07:42:03 +0000
commit57f666497bef6a68df9cc6e37ccf288c462a37b5 (patch)
tree4a1f4c3061ddca46fbe789191b45a6967a7a6889
parentadded timer_Script to OpenSim.ini.example (diff)
downloadopensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.zip
opensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.tar.gz
opensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.tar.bz2
opensim-SC_OLD-57f666497bef6a68df9cc6e37ccf288c462a37b5.tar.xz
* Added hacked support for 'anyone can move' and 'anyone can copy'.
* BACKUP YOUR PRIM BEFORE UPDATING TO THIS and then double check the prim permissions after applying it with a different avatar (then the master avatar or the prim owner avatar). * Also, beware that any objects created under the old permission scheme may react oddly. They may automatically allow anyone to modify them, (which you'll then have to un-set). * It's hacked support because when 'anyone can move is set', any avatar can modify the prim (texture, shape, scale, etc)
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs38
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs189
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs101
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs7
6 files changed, 187 insertions, 153 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index fb957c2..2cb166c 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -234,7 +234,7 @@ namespace OpenSim.Framework
234 234
235 public delegate void GenericCall5(IClientAPI remoteClient, bool status); 235 public delegate void GenericCall5(IClientAPI remoteClient, bool status);
236 236
237 public delegate void GenericCall7(uint localID, string message); 237 public delegate void GenericCall7(IClientAPI remoteClient, uint localID, string message);
238 238
239 public delegate void UpdateShape(LLUUID agentID, uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); 239 public delegate void UpdateShape(LLUUID agentID, uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
240 240
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 5a3e4b7..284a2de 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -1092,11 +1092,13 @@ namespace OpenSim.Region.ClientStack
1092 descend.ItemData[i].SaleType = 0; 1092 descend.ItemData[i].SaleType = 0;
1093 descend.ItemData[i].Type = (sbyte) item.assetType; 1093 descend.ItemData[i].Type = (sbyte) item.assetType;
1094 descend.ItemData[i].CRC = 1094 descend.ItemData[i].CRC =
1095 Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, 1095
1096 descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, 1096 Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType,
1097 descend.ItemData[i].InvType, descend.ItemData[i].Type,
1098 descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, descend.ItemData[i].SalePrice,
1097 descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, 1099 descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID,
1098 descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1100 descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, descend.ItemData[i].EveryoneMask,
1099 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 1101 descend.ItemData[i].Flags, descend.ItemData[i].OwnerMask, descend.ItemData[i].GroupMask, item.inventoryCurrentPermissions);
1100 1102
1101 i++; 1103 i++;
1102 count++; 1104 count++;
@@ -1168,13 +1170,15 @@ namespace OpenSim.Region.ClientStack
1168 inventoryReply.InventoryData[0].SaleType = 0; 1170 inventoryReply.InventoryData[0].SaleType = 0;
1169 inventoryReply.InventoryData[0].Type = (sbyte) item.assetType; 1171 inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
1170 inventoryReply.InventoryData[0].CRC = 1172 inventoryReply.InventoryData[0].CRC =
1171 Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, 1173 Helpers.InventoryCRC(inventoryReply.InventoryData[0].CreationDate, inventoryReply.InventoryData[0].SaleType,
1174 inventoryReply.InventoryData[0].InvType,
1172 inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, 1175 inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
1173 inventoryReply.InventoryData[0].GroupID, 100, 1176 inventoryReply.InventoryData[0].GroupID, inventoryReply.InventoryData[0].SalePrice,
1174 inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID, 1177 inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
1175 inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID, 1178 inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
1176 FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, 1179 inventoryReply.InventoryData[0].EveryoneMask, inventoryReply.InventoryData[0].Flags,
1177 FULL_MASK_PERMISSIONS); 1180 inventoryReply.InventoryData[0].NextOwnerMask, inventoryReply.InventoryData[0].GroupMask,
1181 inventoryReply.InventoryData[0].OwnerMask);
1178 1182
1179 OutPacket(inventoryReply, ThrottleOutPacketType.Asset); 1183 OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
1180 } 1184 }
@@ -1209,13 +1213,16 @@ namespace OpenSim.Region.ClientStack
1209 InventoryReply.InventoryData[0].SaleType = 0; 1213 InventoryReply.InventoryData[0].SaleType = 0;
1210 InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType; 1214 InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
1211 InventoryReply.InventoryData[0].CRC = 1215 InventoryReply.InventoryData[0].CRC =
1212 Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, 1216 Helpers.InventoryCRC(InventoryReply.InventoryData[0].CreationDate, InventoryReply.InventoryData[0].SaleType,
1217 InventoryReply.InventoryData[0].InvType,
1213 InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, 1218 InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
1214 InventoryReply.InventoryData[0].GroupID, 100, 1219 InventoryReply.InventoryData[0].GroupID, InventoryReply.InventoryData[0].SalePrice,
1215 InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, 1220 InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
1216 InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, 1221 InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
1217 FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, 1222 InventoryReply.InventoryData[0].EveryoneMask, InventoryReply.InventoryData[0].Flags,
1218 FULL_MASK_PERMISSIONS); 1223 InventoryReply.InventoryData[0].NextOwnerMask, InventoryReply.InventoryData[0].GroupMask,
1224 InventoryReply.InventoryData[0].OwnerMask);
1225
1219 1226
1220 OutPacket(InventoryReply, ThrottleOutPacketType.Asset); 1227 OutPacket(InventoryReply, ThrottleOutPacketType.Asset);
1221 } 1228 }
@@ -1595,6 +1602,7 @@ namespace OpenSim.Region.ClientStack
1595 outPacket.ObjectData[0].ClickAction = clickAction; 1602 outPacket.ObjectData[0].ClickAction = clickAction;
1596 //outPacket.ObjectData[0].Flags = 0; 1603 //outPacket.ObjectData[0].Flags = 0;
1597 outPacket.ObjectData[0].Radius = 20; 1604 outPacket.ObjectData[0].Radius = 20;
1605
1598 1606
1599 byte[] pb = pos.GetBytes(); 1607 byte[] pb = pos.GetBytes();
1600 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 1608 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
@@ -2039,7 +2047,7 @@ namespace OpenSim.Region.ClientStack
2039 2047
2040 for (int i = 0; i < multipleupdate.ObjectData.Length; i++) 2048 for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
2041 { 2049 {
2042 if (tScene.PermissionsMngr.CanEditObject(simClient.AgentId, tScene.GetSceneObjectPart(multipleupdate.ObjectData[i].ObjectLocalID).UUID)) 2050 if (tScene.PermissionsMngr.CanEditObjectPosition(simClient.AgentId, tScene.GetSceneObjectPart(multipleupdate.ObjectData[i].ObjectLocalID).UUID))
2043 { 2051 {
2044 #region position 2052 #region position
2045 2053
@@ -2896,7 +2904,7 @@ namespace OpenSim.Region.ClientStack
2896 { 2904 {
2897 if (OnObjectDescription != null) 2905 if (OnObjectDescription != null)
2898 { 2906 {
2899 OnObjectDescription(objDes.ObjectData[i].LocalID, 2907 OnObjectDescription(this,objDes.ObjectData[i].LocalID,
2900 enc.GetString(objDes.ObjectData[i].Description)); 2908 enc.GetString(objDes.ObjectData[i].Description));
2901 } 2909 }
2902 } 2910 }
@@ -2907,7 +2915,7 @@ namespace OpenSim.Region.ClientStack
2907 { 2915 {
2908 if (OnObjectName != null) 2916 if (OnObjectName != null)
2909 { 2917 {
2910 OnObjectName(objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name)); 2918 OnObjectName(this,objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name));
2911 } 2919 }
2912 } 2920 }
2913 break; 2921 break;
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 573fc29..37df180 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -35,7 +35,13 @@ namespace OpenSim.Region.Environment
35 public class PermissionManager 35 public class PermissionManager
36 { 36 {
37 protected Scene m_scene; 37 protected Scene m_scene;
38 38
39 // These are here for testing. They will be taken out
40 private uint PERM_ALL = (uint)2147483647;
41 private uint PERM_COPY = (uint)32768;
42 private uint PERM_MODIFY = (uint)16384;
43 private uint PERM_MOVE = (uint)524288;
44 private uint PERM_TRANS = (uint)8192;
39 // Bypasses the permissions engine (always returns OK) 45 // Bypasses the permissions engine (always returns OK)
40 // disable in any production environment 46 // disable in any production environment
41 // TODO: Change this to false when permissions are a desired default 47 // TODO: Change this to false when permissions are a desired default
@@ -136,112 +142,7 @@ namespace OpenSim.Region.Environment
136 #region Object Permissions 142 #region Object Permissions
137 143
138 144
139 public virtual bool AnyoneCanCopyPermission(LLUUID user, LLUUID objId) 145
140 {
141
142 // Default: deny
143 bool permission = false;
144
145 if (!m_scene.Entities.ContainsKey(objId))
146 {
147 return false;
148 }
149
150 // If it's not an object, we cant edit it.
151 if (!(m_scene.Entities[objId] is SceneObjectGroup))
152 {
153 return false;
154 }
155
156 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId];
157 LLUUID taskOwner = null;
158 // Added this because at this point in time it wouldn't be wise for
159 // the administrator object permissions to take effect.
160 LLUUID objectOwner = task.OwnerID;
161 uint objectflags = task.RootPart.EveryoneMask;
162
163 // Object owners should be able to edit their own content
164 if (user == objectOwner)
165 permission = true;
166
167 // If the 'anybody can move' flag is set then allow anyone to copy it
168 if ((objectflags & (uint)LLObject.ObjectFlags.ObjectCopy ) != 0)
169 permission = true;
170
171 // Users should be able to edit what is over their land.
172 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
173 user)
174 permission = true;
175
176 // Estate users should be able to edit anything in the sim
177 if (IsEstateManager(user))
178 permission = true;
179
180 // Admin objects should not be editable by the above
181 if (IsAdministrator(taskOwner))
182 permission = false;
183
184 // Admin should be able to edit anything in the sim (including admin objects)
185 if (IsAdministrator(user))
186 permission = true;
187
188 return permission;
189
190 }
191
192
193 public virtual bool AnyoneCanMovePermission(LLUUID user, LLUUID objId)
194 {
195
196 // Default: deny
197 bool permission = false;
198
199 if (!m_scene.Entities.ContainsKey(objId))
200 {
201 return false;
202 }
203
204 // If it's not an object, we cant edit it.
205 if (!(m_scene.Entities[objId] is SceneObjectGroup))
206 {
207 return false;
208 }
209
210 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId];
211 LLUUID taskOwner = null;
212 // Added this because at this point in time it wouldn't be wise for
213 // the administrator object permissions to take effect.
214 LLUUID objectOwner = task.OwnerID;
215 uint objectflags = task.RootPart.EveryoneMask;
216
217 // Object owners should be able to edit their own content
218 if (user == objectOwner)
219 permission = true;
220
221 // If the 'anybody can move' flag is set then allow anyone to move it
222 if ((objectflags & (uint)LLObject.ObjectFlags.ObjectMove) != 0)
223 permission = true;
224
225 // Users should be able to edit what is over their land.
226 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
227 user)
228 permission = true;
229
230 // Estate users should be able to edit anything in the sim
231 if (IsEstateManager(user))
232 permission = true;
233
234 // Admin objects should not be editable by the above
235 if (IsAdministrator(taskOwner))
236 permission = false;
237
238 // Admin should be able to edit anything in the sim (including admin objects)
239 if (IsAdministrator(user))
240 permission = true;
241
242 return permission;
243
244 }
245 public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID) 146 public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID)
246 { 147 {
247 if (!m_scene.Entities.ContainsKey(objID)) 148 if (!m_scene.Entities.ContainsKey(objID))
@@ -260,6 +161,9 @@ namespace OpenSim.Region.Environment
260 // Added this because at this point in time it wouldn't be wise for 161 // Added this because at this point in time it wouldn't be wise for
261 // the administrator object permissions to take effect. 162 // the administrator object permissions to take effect.
262 LLUUID objectOwner = task.OwnerID; 163 LLUUID objectOwner = task.OwnerID;
164
165 //return task.RootPart.ObjectFlags;task.RootPart.ObjectFlags |
166
263 uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask; 167 uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask;
264 uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask; 168 uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask;
265 uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask; 169 uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask;
@@ -288,7 +192,20 @@ namespace OpenSim.Region.Environment
288 if (IsAdministrator(user)) 192 if (IsAdministrator(user))
289 return OwnerMask; 193 return OwnerMask;
290 194
291 return 0; 195 if (((EveryoneMask & PERM_MOVE) != 0) || ((EveryoneMask & PERM_COPY) != 0))
196 {
197 if ((EveryoneMask & PERM_MOVE) != 0)
198 OwnerMask &= ~PERM_MOVE;
199
200 if ((EveryoneMask & PERM_COPY) != 0)
201 OwnerMask &= ~PERM_COPY;
202
203 OwnerMask &= ~PERM_MODIFY;
204 OwnerMask &= ~PERM_TRANS;
205
206 return OwnerMask;
207 }
208 return EveryoneMask;
292 } 209 }
293 210
294 protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId) 211 protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)
@@ -353,15 +270,61 @@ namespace OpenSim.Region.Environment
353 return GenericObjectPermission(user, obj); 270 return GenericObjectPermission(user, obj);
354 } 271 }
355 272
356 public virtual bool CanReturnObject(LLUUID user, LLUUID obj) 273 public virtual bool CanEditObjectPosition(LLUUID user, LLUUID obj)
357 { 274 {
358 return GenericObjectPermission(user, obj); 275 bool permission = GenericObjectPermission(user,obj);
276 if (!permission)
277 {
278 if (!m_scene.Entities.ContainsKey(obj))
279 {
280 return false;
281 }
282
283 // If it's not an object, we cant edit it.
284 if (!(m_scene.Entities[obj] is SceneObjectGroup))
285 {
286 return false;
287 }
288
289 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj];
290 LLUUID taskOwner = null;
291 // Added this because at this point in time it wouldn't be wise for
292 // the administrator object permissions to take effect.
293 LLUUID objectOwner = task.OwnerID;
294 if ((task.RootPart.EveryoneMask & PERM_MOVE) != 0)
295 permission = true;
296 }
297 return permission;
359 } 298 }
360
361 public virtual bool CanCopyObject(LLUUID user, LLUUID obj) 299 public virtual bool CanCopyObject(LLUUID user, LLUUID obj)
362 { 300 {
363 return true; 301 bool permission = GenericObjectPermission(user, obj);
364 // return GenericObjectPermission(user, obj); 302 if (!permission)
303 {
304 if (!m_scene.Entities.ContainsKey(obj))
305 {
306 return false;
307 }
308
309 // If it's not an object, we cant edit it.
310 if (!(m_scene.Entities[obj] is SceneObjectGroup))
311 {
312 return false;
313 }
314
315 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj];
316 LLUUID taskOwner = null;
317 // Added this because at this point in time it wouldn't be wise for
318 // the administrator object permissions to take effect.
319 LLUUID objectOwner = task.OwnerID;
320 if ((task.RootPart.EveryoneMask & PERM_COPY) != 0)
321 permission = true;
322 }
323 return permission;
324 }
325 public virtual bool CanReturnObject(LLUUID user, LLUUID obj)
326 {
327 return GenericObjectPermission(user, obj);
365 } 328 }
366 329
367 #endregion 330 #endregion
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 04bdf5a..501f519 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -443,7 +443,12 @@ namespace OpenSim.Region.Environment.Scenes
443 { 443 {
444 SceneObjectGroup group = GetGroupByPrim(localID); 444 SceneObjectGroup group = GetGroupByPrim(localID);
445 if (group != null) 445 if (group != null)
446 group.Resize(scale, localID); 446 {
447 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
448 {
449 group.Resize(scale, localID);
450 }
451 }
447 } 452 }
448 453
449 /// <summary> 454 /// <summary>
@@ -473,7 +478,12 @@ namespace OpenSim.Region.Environment.Scenes
473 { 478 {
474 SceneObjectGroup group = GetGroupByPrim(localID); 479 SceneObjectGroup group = GetGroupByPrim(localID);
475 if (group != null) 480 if (group != null)
476 group.UpdateSingleRotation(rot, localID); 481 {
482 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
483 {
484 group.UpdateSingleRotation(rot, localID);
485 }
486 }
477 } 487 }
478 488
479 /// <summary> 489 /// <summary>
@@ -486,7 +496,12 @@ namespace OpenSim.Region.Environment.Scenes
486 { 496 {
487 SceneObjectGroup group = GetGroupByPrim(localID); 497 SceneObjectGroup group = GetGroupByPrim(localID);
488 if (group != null) 498 if (group != null)
489 group.UpdateGroupRotation(rot); 499 {
500 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
501 {
502 group.UpdateGroupRotation(rot);
503 }
504 }
490 } 505 }
491 506
492 /// <summary> 507 /// <summary>
@@ -500,14 +515,24 @@ namespace OpenSim.Region.Environment.Scenes
500 { 515 {
501 SceneObjectGroup group = GetGroupByPrim(localID); 516 SceneObjectGroup group = GetGroupByPrim(localID);
502 if (group != null) 517 if (group != null)
503 group.UpdateGroupRotation(pos, rot); 518 {
519 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
520 {
521 group.UpdateGroupRotation(pos, rot);
522 }
523 }
504 } 524 }
505 525
506 public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient) 526 public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
507 { 527 {
508 SceneObjectGroup group = GetGroupByPrim(localID); 528 SceneObjectGroup group = GetGroupByPrim(localID);
509 if (group != null) 529 if (group != null)
510 group.UpdateSinglePosition(pos, localID); 530 {
531 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
532 {
533 group.UpdateSinglePosition(pos, localID);
534 }
535 }
511 } 536 }
512 537
513 /// <summary> 538 /// <summary>
@@ -520,7 +545,12 @@ namespace OpenSim.Region.Environment.Scenes
520 { 545 {
521 SceneObjectGroup group = GetGroupByPrim(localID); 546 SceneObjectGroup group = GetGroupByPrim(localID);
522 if (group != null) 547 if (group != null)
523 group.UpdateGroupPosition(pos); 548 {
549 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
550 {
551 group.UpdateGroupPosition(pos);
552 }
553 }
524 } 554 }
525 555
526 /// <summary> 556 /// <summary>
@@ -533,7 +563,12 @@ namespace OpenSim.Region.Environment.Scenes
533 { 563 {
534 SceneObjectGroup group = GetGroupByPrim(localID); 564 SceneObjectGroup group = GetGroupByPrim(localID);
535 if (group != null) 565 if (group != null)
536 group.UpdateTextureEntry(localID, texture); 566 {
567 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
568 {
569 group.UpdateTextureEntry(localID, texture);
570 }
571 }
537 } 572 }
538 573
539 /// <summary> 574 /// <summary>
@@ -546,17 +581,24 @@ namespace OpenSim.Region.Environment.Scenes
546 { 581 {
547 SceneObjectGroup group = GetGroupByPrim(localID); 582 SceneObjectGroup group = GetGroupByPrim(localID);
548 if (group != null) 583 if (group != null)
549 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes()); 584 {
550 //System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString()); 585 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
586 {
587 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
588 }
589 }
590
551 } 591 }
552 592
553 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 593 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
554 { 594 {
555 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, objectID) || PermissionsMngr.AnyoneCanMovePermission(remoteClient.AgentId, objectID)) 595 SceneObjectGroup group = GetGroupByPrim(objectID);
596 if (group != null)
556 { 597 {
557 SceneObjectGroup group = GetGroupByPrim(objectID); 598 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
558 if (group != null) 599 {
559 group.GrabMovement(offset, pos, remoteClient); 600 group.GrabMovement(offset, pos, remoteClient);
601 }
560 } 602 }
561 } 603 }
562 604
@@ -565,11 +607,16 @@ namespace OpenSim.Region.Environment.Scenes
565 /// </summary> 607 /// </summary>
566 /// <param name="primLocalID"></param> 608 /// <param name="primLocalID"></param>
567 /// <param name="description"></param> 609 /// <param name="description"></param>
568 public void PrimName(uint primLocalID, string name) 610 public void PrimName(IClientAPI remoteClient, uint primLocalID, string name)
569 { 611 {
570 SceneObjectGroup group = GetGroupByPrim(primLocalID); 612 SceneObjectGroup group = GetGroupByPrim(primLocalID);
571 if (group != null) 613 if (group != null)
572 group.SetPartName(name, primLocalID); 614 {
615 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
616 {
617 group.SetPartName(name, primLocalID);
618 }
619 }
573 } 620 }
574 621
575 /// <summary> 622 /// <summary>
@@ -577,21 +624,30 @@ namespace OpenSim.Region.Environment.Scenes
577 /// </summary> 624 /// </summary>
578 /// <param name="primLocalID"></param> 625 /// <param name="primLocalID"></param>
579 /// <param name="description"></param> 626 /// <param name="description"></param>
580 public void PrimDescription(uint primLocalID, string description) 627 public void PrimDescription(IClientAPI remoteClient, uint primLocalID, string description)
581 { 628 {
582 SceneObjectGroup group = GetGroupByPrim(primLocalID); 629 SceneObjectGroup group = GetGroupByPrim(primLocalID);
583 if (group != null) 630 if (group != null)
584 group.SetPartDescription(description, primLocalID); 631 {
632 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
633 {
634 group.SetPartDescription(description, primLocalID);
635 }
636 }
585 } 637 }
586 638
587 public void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) 639 public void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
588 { 640 {
589 SceneObjectGroup group = GetGroupByPrim(primLocalID); 641 SceneObjectGroup group = GetGroupByPrim(primLocalID);
590 if (this.m_parentScene.PermissionsMngr.CanEditObject(agentID, group.GetPartsFullID(primLocalID))) 642
643 if (group != null)
591 { 644 {
592 if (group != null) 645 if (PermissionsMngr.CanEditObject(agentID, group.UUID))
646 {
593 group.UpdateExtraParam(primLocalID, type, inUse, data); 647 group.UpdateExtraParam(primLocalID, type, inUse, data);
648 }
594 } 649 }
650
595 } 651 }
596 652
597 /// <summary> 653 /// <summary>
@@ -602,10 +658,13 @@ namespace OpenSim.Region.Environment.Scenes
602 public void UpdatePrimShape(LLUUID agentID, uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) 658 public void UpdatePrimShape(LLUUID agentID, uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
603 { 659 {
604 SceneObjectGroup group = GetGroupByPrim(primLocalID); 660 SceneObjectGroup group = GetGroupByPrim(primLocalID);
605 if (this.m_parentScene.PermissionsMngr.CanEditObject(agentID, group.GetPartsFullID(primLocalID))) 661 if (group != null)
606 { 662 {
607 if (group != null) 663 if (PermissionsMngr.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID)))
664 {
665
608 group.UpdateShape(shapeBlock, primLocalID); 666 group.UpdateShape(shapeBlock, primLocalID);
667 }
609 } 668 }
610 } 669 }
611 670
@@ -724,7 +783,7 @@ namespace OpenSim.Region.Environment.Scenes
724 783
725 if (originPrim != null) 784 if (originPrim != null)
726 { 785 {
727 if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID) || PermissionsMngr.AnyoneCanCopyPermission(AgentID, originPrim.UUID)) 786 if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID))
728 { 787 {
729 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID); 788 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
730 copy.AbsolutePosition = copy.AbsolutePosition + offset; 789 copy.AbsolutePosition = copy.AbsolutePosition + offset;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index dbcd332..6c8b3bf 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -448,6 +448,9 @@ namespace OpenSim.Region.Environment.Scenes
448 item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; 448 item.parentFolderID = DeRezPacket.AgentBlock.DestinationID;
449 item.inventoryCurrentPermissions = 2147483647; 449 item.inventoryCurrentPermissions = 2147483647;
450 item.inventoryNextPermissions = 2147483647; 450 item.inventoryNextPermissions = 2147483647;
451 item.inventoryEveryOnePermissions = ((SceneObjectGroup)selectedEnt).RootPart.EveryoneMask;
452 item.inventoryBasePermissions = ((SceneObjectGroup)selectedEnt).RootPart.BaseMask;
453 item.inventoryCurrentPermissions = ((SceneObjectGroup)selectedEnt).RootPart.OwnerMask;
451 454
452 userInfo.AddItem(remoteClient.AgentId, item); 455 userInfo.AddItem(remoteClient.AgentId, item);
453 remoteClient.SendInventoryItemCreateUpdate(item); 456 remoteClient.SendInventoryItemCreateUpdate(item);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 238e78a..bf02e8d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -851,7 +851,7 @@ namespace OpenSim.Region.Environment.Scenes
851 m_flags |= flag; 851 m_flags |= flag;
852 852
853 } 853 }
854 uint currflag = (uint)m_flags; 854 //uint currflag = (uint)m_flags;
855 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString()); 855 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
856 //ScheduleFullUpdate(); 856 //ScheduleFullUpdate();
857 } 857 }
@@ -1295,7 +1295,8 @@ namespace OpenSim.Region.Environment.Scenes
1295 //EveryoneMask |= (uint)57344; 1295 //EveryoneMask |= (uint)57344;
1296 1296
1297 } 1297 }
1298 ScheduleFullUpdate(); 1298 //ScheduleFullUpdate();
1299 SendFullUpdateToAllClients();
1299 } 1300 }
1300 //Field 16 = NextownerMask 1301 //Field 16 = NextownerMask
1301 if (field == (byte)16) 1302 if (field == (byte)16)
@@ -1308,7 +1309,7 @@ namespace OpenSim.Region.Environment.Scenes
1308 { 1309 {
1309 NextOwnerMask |= mask; 1310 NextOwnerMask |= mask;
1310 } 1311 }
1311 ScheduleFullUpdate(); 1312 SendFullUpdateToAllClients();
1312 } 1313 }
1313 1314
1314 } 1315 }