aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 721680f..8a7096f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using System.Reflection; 29using System.Reflection;
29using libsecondlife; 30using libsecondlife;
30using log4net; 31using log4net;
@@ -282,5 +283,38 @@ namespace OpenSim.Region.Environment.Scenes
282 283
283 return -1; 284 return -1;
284 } 285 }
286
287 public uint GetEffectivePermissions()
288 {
289 uint perms=(uint)(PermissionMask.Modify |
290 PermissionMask.Copy |
291 PermissionMask.Move |
292 PermissionMask.Transfer) | 7;
293
294 foreach (SceneObjectPart part in m_parts.Values)
295 perms &= part.MaskEffectivePermissions();
296
297 if((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
298 perms &= ~(uint)PermissionMask.Modify;
299 if((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0)
300 perms &= ~(uint)PermissionMask.Copy;
301 if((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
302 perms &= ~(uint)PermissionMask.Transfer;
303
304 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
305 perms &= ~((uint)PermissionMask.Modify >> 13);
306 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
307 perms &= ~((uint)PermissionMask.Copy >> 13);
308 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
309 perms &= ~((uint)PermissionMask.Transfer >> 13);
310
311 return perms;
312 }
313
314 public void ApplyNextOwnerPermissions()
315 {
316 foreach (SceneObjectPart part in m_parts.Values)
317 part.ApplyNextOwnerPermissions();
318 }
285 } 319 }
286} 320}