aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorSean Dague2008-07-23 22:14:29 +0000
committerSean Dague2008-07-23 22:14:29 +0000
commitcf317f5c3352f066fd61a0fa5de19c93947be22c (patch)
tree2decd9652f6270789713f98b2ac550395b125c08 /OpenSim/Region/Environment
parentadd primitems migration for nhibernate (diff)
downloadopensim-SC-cf317f5c3352f066fd61a0fa5de19c93947be22c.zip
opensim-SC-cf317f5c3352f066fd61a0fa5de19c93947be22c.tar.gz
opensim-SC-cf317f5c3352f066fd61a0fa5de19c93947be22c.tar.bz2
opensim-SC-cf317f5c3352f066fd61a0fa5de19c93947be22c.tar.xz
refactor TaskInventoryItem Mask -> Permissions to be consistant with how things
are stored in the db.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs100
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs42
3 files changed, 75 insertions, 75 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 5caf0f0..d0c5842 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -919,22 +919,22 @@ namespace OpenSim.Region.Environment.Scenes
919 919
920 if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 920 if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
921 { 921 {
922 agentItem.BasePermissions = taskItem.NextOwnerMask; 922 agentItem.BasePermissions = taskItem.NextPermissions;
923 agentItem.CurrentPermissions = taskItem.NextOwnerMask; 923 agentItem.CurrentPermissions = taskItem.NextPermissions;
924 agentItem.NextPermissions = taskItem.NextOwnerMask; 924 agentItem.NextPermissions = taskItem.NextPermissions;
925 agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask; 925 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
926 } 926 }
927 else 927 else
928 { 928 {
929 agentItem.BasePermissions = taskItem.BaseMask; 929 agentItem.BasePermissions = taskItem.BasePermissions;
930 agentItem.CurrentPermissions = taskItem.OwnerMask; 930 agentItem.CurrentPermissions = taskItem.CurrentPermissions;
931 agentItem.NextPermissions = taskItem.NextOwnerMask; 931 agentItem.NextPermissions = taskItem.NextPermissions;
932 agentItem.EveryOnePermissions = taskItem.EveryoneMask; 932 agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
933 } 933 }
934 934
935 if (!ExternalChecks.ExternalChecksBypassPermissions()) 935 if (!ExternalChecks.ExternalChecksBypassPermissions())
936 { 936 {
937 if ((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) 937 if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
938 part.RemoveInventoryItem(itemId); 938 part.RemoveInventoryItem(itemId);
939 } 939 }
940 940
@@ -1083,26 +1083,26 @@ namespace OpenSim.Region.Environment.Scenes
1083 destTaskItem.ParentID = destPart.UUID; 1083 destTaskItem.ParentID = destPart.UUID;
1084 destTaskItem.ParentPartID = destPart.UUID; 1084 destTaskItem.ParentPartID = destPart.UUID;
1085 1085
1086 destTaskItem.BaseMask = srcTaskItem.BaseMask; 1086 destTaskItem.BasePermissions = srcTaskItem.BasePermissions;
1087 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; 1087 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions;
1088 destTaskItem.GroupMask = srcTaskItem.GroupMask; 1088 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions;
1089 destTaskItem.OwnerMask = srcTaskItem.OwnerMask; 1089 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions;
1090 destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask; 1090 destTaskItem.NextPermissions = srcTaskItem.NextPermissions;
1091 destTaskItem.Flags = srcTaskItem.Flags; 1091 destTaskItem.Flags = srcTaskItem.Flags;
1092 1092
1093 if (destPart.OwnerID != part.OwnerID) 1093 if (destPart.OwnerID != part.OwnerID)
1094 { 1094 {
1095 if (ExternalChecks.ExternalChecksPropagatePermissions()) 1095 if (ExternalChecks.ExternalChecksPropagatePermissions())
1096 { 1096 {
1097 destTaskItem.OwnerMask = srcTaskItem.OwnerMask & 1097 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
1098 srcTaskItem.NextOwnerMask; 1098 srcTaskItem.NextPermissions;
1099 destTaskItem.GroupMask = srcTaskItem.GroupMask & 1099 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
1100 srcTaskItem.NextOwnerMask; 1100 srcTaskItem.NextPermissions;
1101 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask & 1101 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
1102 srcTaskItem.NextOwnerMask; 1102 srcTaskItem.NextPermissions;
1103 destTaskItem.BaseMask = srcTaskItem.BaseMask & 1103 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1104 srcTaskItem.NextOwnerMask; 1104 srcTaskItem.NextPermissions;
1105 destTaskItem.OwnerMask |= 8; // Slam! 1105 destTaskItem.CurrentPermissions |= 8; // Slam!
1106 } 1106 }
1107 } 1107 }
1108 1108
@@ -1113,7 +1113,7 @@ namespace OpenSim.Region.Environment.Scenes
1113 1113
1114 destPart.AddInventoryItem(destTaskItem); 1114 destPart.AddInventoryItem(destTaskItem);
1115 1115
1116 if ((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) 1116 if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1117 part.RemoveInventoryItem(itemId); 1117 part.RemoveInventoryItem(itemId);
1118 1118
1119 ScenePresence avatar; 1119 ScenePresence avatar;
@@ -1331,12 +1331,12 @@ namespace OpenSim.Region.Environment.Scenes
1331 taskItem.InvType = itemBase.InvType; 1331 taskItem.InvType = itemBase.InvType;
1332 taskItem.OwnerID = itemBase.Owner; 1332 taskItem.OwnerID = itemBase.Owner;
1333 taskItem.CreatorID = itemBase.Creator; 1333 taskItem.CreatorID = itemBase.Creator;
1334 taskItem.BaseMask = itemBase.BasePermissions; 1334 taskItem.BasePermissions = itemBase.BasePermissions;
1335 taskItem.OwnerMask = itemBase.CurrentPermissions; 1335 taskItem.CurrentPermissions = itemBase.CurrentPermissions;
1336 taskItem.EveryoneMask = itemBase.EveryOnePermissions; 1336 taskItem.EveryonePermissions = itemBase.EveryOnePermissions;
1337 taskItem.NextOwnerMask = itemBase.NextPermissions; 1337 taskItem.NextPermissions = itemBase.NextPermissions;
1338 taskItem.GroupID = itemBase.GroupID; 1338 taskItem.GroupID = itemBase.GroupID;
1339 taskItem.GroupMask = 0; 1339 taskItem.GroupPermissions = 0;
1340 taskItem.Flags = itemBase.Flags; 1340 taskItem.Flags = itemBase.Flags;
1341 taskItem.PermsGranter = LLUUID.Zero; 1341 taskItem.PermsGranter = LLUUID.Zero;
1342 taskItem.PermsMask = 0; 1342 taskItem.PermsMask = 0;
@@ -1409,26 +1409,26 @@ namespace OpenSim.Region.Environment.Scenes
1409 destTaskItem.ParentID = destPart.UUID; 1409 destTaskItem.ParentID = destPart.UUID;
1410 destTaskItem.ParentPartID = destPart.UUID; 1410 destTaskItem.ParentPartID = destPart.UUID;
1411 1411
1412 destTaskItem.BaseMask = srcTaskItem.BaseMask; 1412 destTaskItem.BasePermissions = srcTaskItem.BasePermissions;
1413 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; 1413 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions;
1414 destTaskItem.GroupMask = srcTaskItem.GroupMask; 1414 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions;
1415 destTaskItem.OwnerMask = srcTaskItem.OwnerMask; 1415 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions;
1416 destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask; 1416 destTaskItem.NextPermissions = srcTaskItem.NextPermissions;
1417 destTaskItem.Flags = srcTaskItem.Flags; 1417 destTaskItem.Flags = srcTaskItem.Flags;
1418 1418
1419 if (destPart.OwnerID != srcPart.OwnerID) 1419 if (destPart.OwnerID != srcPart.OwnerID)
1420 { 1420 {
1421 if (ExternalChecks.ExternalChecksPropagatePermissions()) 1421 if (ExternalChecks.ExternalChecksPropagatePermissions())
1422 { 1422 {
1423 destTaskItem.OwnerMask = srcTaskItem.OwnerMask & 1423 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
1424 srcTaskItem.NextOwnerMask; 1424 srcTaskItem.NextPermissions;
1425 destTaskItem.GroupMask = srcTaskItem.GroupMask & 1425 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
1426 srcTaskItem.NextOwnerMask; 1426 srcTaskItem.NextPermissions;
1427 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask & 1427 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
1428 srcTaskItem.NextOwnerMask; 1428 srcTaskItem.NextPermissions;
1429 destTaskItem.BaseMask = srcTaskItem.BaseMask & 1429 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1430 srcTaskItem.NextOwnerMask; 1430 srcTaskItem.NextPermissions;
1431 destTaskItem.OwnerMask |= 8; // Slam! 1431 destTaskItem.CurrentPermissions |= 8; // Slam!
1432 } 1432 }
1433 } 1433 }
1434 1434
@@ -2088,12 +2088,12 @@ namespace OpenSim.Region.Environment.Scenes
2088 { 2088 {
2089 if (ExternalChecks.ExternalChecksPropagatePermissions()) 2089 if (ExternalChecks.ExternalChecksPropagatePermissions())
2090 { 2090 {
2091 if ((item.OwnerMask & 8) != 0) 2091 if ((item.CurrentPermissions & 8) != 0)
2092 { 2092 {
2093 foreach (SceneObjectPart part in partList) 2093 foreach (SceneObjectPart part in partList)
2094 { 2094 {
2095 part.EveryoneMask = item.EveryoneMask; 2095 part.EveryoneMask = item.EveryonePermissions;
2096 part.NextOwnerMask = item.NextOwnerMask; 2096 part.NextOwnerMask = item.NextPermissions;
2097 } 2097 }
2098 } 2098 }
2099 group.ApplyNextOwnerPermissions(); 2099 group.ApplyNextOwnerPermissions();
@@ -2108,10 +2108,10 @@ namespace OpenSim.Region.Environment.Scenes
2108 part.OwnerID = item.OwnerID; 2108 part.OwnerID = item.OwnerID;
2109 part.ChangeInventoryOwner(item.OwnerID); 2109 part.ChangeInventoryOwner(item.OwnerID);
2110 } 2110 }
2111 else if ((item.OwnerMask & 8) != 0) // Slam! 2111 else if ((item.CurrentPermissions & 8) != 0) // Slam!
2112 { 2112 {
2113 part.EveryoneMask = item.EveryoneMask; 2113 part.EveryoneMask = item.EveryonePermissions;
2114 part.NextOwnerMask = item.NextOwnerMask; 2114 part.NextOwnerMask = item.NextPermissions;
2115 } 2115 }
2116 } 2116 }
2117 rootPart.TrimPermissions(); 2117 rootPart.TrimPermissions();
@@ -2127,7 +2127,7 @@ namespace OpenSim.Region.Environment.Scenes
2127 2127
2128 if (!ExternalChecks.ExternalChecksBypassPermissions()) 2128 if (!ExternalChecks.ExternalChecksBypassPermissions())
2129 { 2129 {
2130 if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0) 2130 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
2131 sourcePart.RemoveInventoryItem(item.ItemID); 2131 sourcePart.RemoveInventoryItem(item.ItemID);
2132 } 2132 }
2133 return rootPart.ParentGroup; 2133 return rootPart.ParentGroup;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 0696432..cc4891f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -151,11 +151,11 @@ namespace OpenSim.Region.Environment.Scenes
151 taskItem.Type = item.AssetType; 151 taskItem.Type = item.AssetType;
152 taskItem.InvType = item.InvType; 152 taskItem.InvType = item.InvType;
153 153
154 taskItem.BaseMask = item.BasePermissions; 154 taskItem.BasePermissions = item.BasePermissions;
155 taskItem.OwnerMask = item.CurrentPermissions; 155 taskItem.CurrentPermissions = item.CurrentPermissions;
156 // FIXME: ignoring group permissions for now as they aren't stored in item 156 // FIXME: ignoring group permissions for now as they aren't stored in item
157 taskItem.EveryoneMask = item.EveryOnePermissions; 157 taskItem.EveryonePermissions = item.EveryOnePermissions;
158 taskItem.NextOwnerMask = item.NextPermissions; 158 taskItem.NextPermissions = item.NextPermissions;
159 taskItem.Flags = item.Flags; 159 taskItem.Flags = item.Flags;
160 // TODO: These are pending addition of those fields to TaskInventoryItem 160 // TODO: These are pending addition of those fields to TaskInventoryItem
161// taskItem.SalePrice = item.SalePrice; 161// taskItem.SalePrice = item.SalePrice;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 841b7b6..480c030 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -526,8 +526,8 @@ namespace OpenSim.Region.Environment.Scenes
526 { 526 {
527 LLUUID ownerID = item.OwnerID; 527 LLUUID ownerID = item.OwnerID;
528 uint everyoneMask = 0; 528 uint everyoneMask = 0;
529 uint baseMask = item.BaseMask; 529 uint baseMask = item.BasePermissions;
530 uint ownerMask = item.OwnerMask; 530 uint ownerMask = item.CurrentPermissions;
531 531
532 if (item.InvType == 10) // Script 532 if (item.InvType == 10) // Script
533 { 533 {
@@ -557,7 +557,7 @@ namespace OpenSim.Region.Environment.Scenes
557 invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask)); 557 invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask));
558 invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0)); 558 invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0));
559 invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask)); 559 invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask));
560 invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask)); 560 invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextPermissions));
561 561
562 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 562 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
563 invString.AddNameValueLine("owner_id", ownerID.ToString()); 563 invString.AddNameValueLine("owner_id", ownerID.ToString());
@@ -680,28 +680,28 @@ namespace OpenSim.Region.Environment.Scenes
680 { 680 {
681 if (item.InvType != 6) 681 if (item.InvType != 6)
682 { 682 {
683 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 683 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
684 mask &= ~((uint)PermissionMask.Copy >> 13); 684 mask &= ~((uint)PermissionMask.Copy >> 13);
685 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 685 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
686 mask &= ~((uint)PermissionMask.Transfer >> 13); 686 mask &= ~((uint)PermissionMask.Transfer >> 13);
687 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 687 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
688 mask &= ~((uint)PermissionMask.Modify >> 13); 688 mask &= ~((uint)PermissionMask.Modify >> 13);
689 } 689 }
690 else 690 else
691 { 691 {
692 if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) 692 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
693 mask &= ~((uint)PermissionMask.Copy >> 13); 693 mask &= ~((uint)PermissionMask.Copy >> 13);
694 if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) 694 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
695 mask &= ~((uint)PermissionMask.Transfer >> 13); 695 mask &= ~((uint)PermissionMask.Transfer >> 13);
696 if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) 696 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
697 mask &= ~((uint)PermissionMask.Modify >> 13); 697 mask &= ~((uint)PermissionMask.Modify >> 13);
698 } 698 }
699 699
700 if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0) 700 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
701 mask &= ~(uint)PermissionMask.Copy; 701 mask &= ~(uint)PermissionMask.Copy;
702 if ((item.OwnerMask & (uint)PermissionMask.Transfer) == 0) 702 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
703 mask &= ~(uint)PermissionMask.Transfer; 703 mask &= ~(uint)PermissionMask.Transfer;
704 if ((item.OwnerMask & (uint)PermissionMask.Modify) == 0) 704 if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
705 mask &= ~(uint)PermissionMask.Modify; 705 mask &= ~(uint)PermissionMask.Modify;
706 } 706 }
707 return mask; 707 return mask;
@@ -717,16 +717,16 @@ namespace OpenSim.Region.Environment.Scenes
717 { 717 {
718 if (item.InvType == 6) 718 if (item.InvType == 6)
719 { 719 {
720 if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) 720 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
721 item.OwnerMask &= ~(uint)PermissionMask.Copy; 721 item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
722 if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) 722 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
723 item.OwnerMask &= ~(uint)PermissionMask.Transfer; 723 item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
724 if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) 724 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
725 item.OwnerMask &= ~(uint)PermissionMask.Modify; 725 item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
726 } 726 }
727 item.OwnerMask &= item.NextOwnerMask; 727 item.CurrentPermissions &= item.NextPermissions;
728 item.BaseMask &= item.NextOwnerMask; 728 item.BasePermissions &= item.NextPermissions;
729 item.EveryoneMask &= item.NextOwnerMask; 729 item.EveryonePermissions &= item.NextPermissions;
730 } 730 }
731 731
732 TriggerScriptChangedEvent(Changed.OWNER); 732 TriggerScriptChangedEvent(Changed.OWNER);