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 9265805..c2f0792 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); |
@@ -4319,10 +4319,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4319 | 4319 | ||
4320 | public void TrimPermissions() | 4320 | public void TrimPermissions() |
4321 | { | 4321 | { |
4322 | BaseMask &= (uint)PermissionMask.All; | 4322 | BaseMask &= (uint)(PermissionMask.All | PermissionMask.Export); |
4323 | OwnerMask &= (uint)PermissionMask.All; | 4323 | OwnerMask &= (uint)(PermissionMask.All | PermissionMask.Export); |
4324 | GroupMask &= (uint)PermissionMask.All; | 4324 | GroupMask &= (uint)PermissionMask.All; |
4325 | EveryoneMask &= (uint)PermissionMask.All; | 4325 | EveryoneMask &= (uint)(PermissionMask.All | PermissionMask.Export); |
4326 | NextOwnerMask &= (uint)PermissionMask.All; | 4326 | NextOwnerMask &= (uint)PermissionMask.All; |
4327 | } | 4327 | } |
4328 | 4328 | ||
@@ -4425,10 +4425,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
4425 | baseMask; | 4425 | baseMask; |
4426 | break; | 4426 | break; |
4427 | case 8: | 4427 | case 8: |
4428 | // Trying to set export permissions - extra checks | ||
4429 | if (set && (mask & (uint)PermissionMask.Export) != 0) | ||
4430 | { | ||
4431 | if ((OwnerMask & (uint)PermissionMask.Export) == 0 || (BaseMask & (uint)PermissionMask.Export) == 0 || (NextOwnerMask & (uint)PermissionMask.All) != (uint)PermissionMask.All) | ||
4432 | mask &= ~(uint)PermissionMask.Export; | ||
4433 | } | ||
4428 | EveryoneMask = ApplyMask(EveryoneMask, set, mask) & | 4434 | EveryoneMask = ApplyMask(EveryoneMask, set, mask) & |
4429 | baseMask; | 4435 | baseMask; |
4430 | break; | 4436 | break; |
4431 | case 16: | 4437 | case 16: |
4438 | // Force full perm if export | ||
4439 | if ((EveryoneMask & (uint)PermissionMask.Export) != 0) | ||
4440 | { | ||
4441 | NextOwnerMask = (uint)PermissionMask.All; | ||
4442 | break; | ||
4443 | } | ||
4432 | NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & | 4444 | NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & |
4433 | baseMask; | 4445 | baseMask; |
4434 | // Prevent the client from creating no copy, no transfer | 4446 | // Prevent the client from creating no copy, no transfer |
@@ -5225,9 +5237,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
5225 | 5237 | ||
5226 | public void ApplyNextOwnerPermissions() | 5238 | public void ApplyNextOwnerPermissions() |
5227 | { | 5239 | { |
5228 | BaseMask &= NextOwnerMask; | 5240 | // Export needs to be preserved in the base and everyone |
5241 | // mask, but removed in the owner mask as a next owner | ||
5242 | // can never change the export status | ||
5243 | BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; | ||
5229 | OwnerMask &= NextOwnerMask; | 5244 | OwnerMask &= NextOwnerMask; |
5230 | EveryoneMask &= NextOwnerMask; | 5245 | EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; |
5231 | 5246 | ||
5232 | Inventory.ApplyNextOwnerPermissions(); | 5247 | Inventory.ApplyNextOwnerPermissions(); |
5233 | } | 5248 | } |