diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6839614..42644dc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -470,8 +470,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
470 | private uint _category; | 470 | private uint _category; |
471 | private Int32 _creationDate; | 471 | private Int32 _creationDate; |
472 | private uint _parentID = 0; | 472 | private uint _parentID = 0; |
473 | private uint _baseMask = (uint)PermissionMask.All; | 473 | private uint _baseMask = (uint)(PermissionMask.All | PermissionMask.Export); |
474 | private uint _ownerMask = (uint)PermissionMask.All; | 474 | private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export); |
475 | private uint _groupMask = (uint)PermissionMask.None; | 475 | private uint _groupMask = (uint)PermissionMask.None; |
476 | private uint _everyoneMask = (uint)PermissionMask.None; | 476 | private uint _everyoneMask = (uint)PermissionMask.None; |
477 | private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); | 477 | private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); |
@@ -4323,10 +4323,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4323 | 4323 | ||
4324 | public void TrimPermissions() | 4324 | public void TrimPermissions() |
4325 | { | 4325 | { |
4326 | BaseMask &= (uint)PermissionMask.All; | 4326 | BaseMask &= (uint)(PermissionMask.All | PermissionMask.Export); |
4327 | OwnerMask &= (uint)PermissionMask.All; | 4327 | OwnerMask &= (uint)(PermissionMask.All | PermissionMask.Export); |
4328 | GroupMask &= (uint)PermissionMask.All; | 4328 | GroupMask &= (uint)PermissionMask.All; |
4329 | EveryoneMask &= (uint)PermissionMask.All; | 4329 | EveryoneMask &= (uint)(PermissionMask.All | PermissionMask.Export); |
4330 | NextOwnerMask &= (uint)PermissionMask.All; | 4330 | NextOwnerMask &= (uint)PermissionMask.All; |
4331 | } | 4331 | } |
4332 | 4332 | ||
@@ -4429,10 +4429,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
4429 | baseMask; | 4429 | baseMask; |
4430 | break; | 4430 | break; |
4431 | case 8: | 4431 | case 8: |
4432 | // Trying to set export permissions - extra checks | ||
4433 | if (set && (mask & (uint)PermissionMask.Export) != 0) | ||
4434 | { | ||
4435 | if ((OwnerMask & (uint)PermissionMask.Export) == 0 || (BaseMask & (uint)PermissionMask.Export) == 0 || (NextOwnerMask & (uint)PermissionMask.All) != (uint)PermissionMask.All) | ||
4436 | mask &= ~(uint)PermissionMask.Export; | ||
4437 | } | ||
4432 | EveryoneMask = ApplyMask(EveryoneMask, set, mask) & | 4438 | EveryoneMask = ApplyMask(EveryoneMask, set, mask) & |
4433 | baseMask; | 4439 | baseMask; |
4434 | break; | 4440 | break; |
4435 | case 16: | 4441 | case 16: |
4442 | // Force full perm if export | ||
4443 | if ((EveryoneMask & (uint)PermissionMask.Export) != 0) | ||
4444 | { | ||
4445 | NextOwnerMask = (uint)PermissionMask.All; | ||
4446 | break; | ||
4447 | } | ||
4436 | NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & | 4448 | NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & |
4437 | baseMask; | 4449 | baseMask; |
4438 | // Prevent the client from creating no copy, no transfer | 4450 | // Prevent the client from creating no copy, no transfer |
@@ -5229,9 +5241,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
5229 | 5241 | ||
5230 | public void ApplyNextOwnerPermissions() | 5242 | public void ApplyNextOwnerPermissions() |
5231 | { | 5243 | { |
5232 | BaseMask &= NextOwnerMask; | 5244 | // Export needs to be preserved in the base and everyone |
5245 | // mask, but removed in the owner mask as a next owner | ||
5246 | // can never change the export status | ||
5247 | BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; | ||
5233 | OwnerMask &= NextOwnerMask; | 5248 | OwnerMask &= NextOwnerMask; |
5234 | EveryoneMask &= NextOwnerMask; | 5249 | EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; |
5235 | 5250 | ||
5236 | Inventory.ApplyNextOwnerPermissions(); | 5251 | Inventory.ApplyNextOwnerPermissions(); |
5237 | } | 5252 | } |