refactor TaskInventoryItem Mask -> Permissions to be consistant with how things

are stored in the db.
0.6.0-stable
Sean Dague 2008-07-23 22:14:29 +00:00
parent 3c227390c0
commit cf317f5c33
11 changed files with 145 additions and 128 deletions

View File

@ -973,11 +973,11 @@ namespace OpenSim.Data.MSSQL
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]); taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
taskItem.GroupID = new LLUUID((String)row["groupID"]); taskItem.GroupID = new LLUUID((String)row["groupID"]);
taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]); taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]); taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]); taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]); taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]); taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]);
// taskItem.Flags = Convert.ToUInt32(row["flags"]); // taskItem.Flags = Convert.ToUInt32(row["flags"]);
return taskItem; return taskItem;
@ -1170,11 +1170,11 @@ namespace OpenSim.Data.MSSQL
row["ownerID"] = taskItem.OwnerID; row["ownerID"] = taskItem.OwnerID;
row["lastOwnerID"] = taskItem.LastOwnerID; row["lastOwnerID"] = taskItem.LastOwnerID;
row["groupID"] = taskItem.GroupID; row["groupID"] = taskItem.GroupID;
row["nextPermissions"] = taskItem.NextOwnerMask; row["nextPermissions"] = taskItem.NextPermissions;
row["currentPermissions"] = taskItem.OwnerMask; row["currentPermissions"] = taskItem.CurrentPermissions;
row["basePermissions"] = taskItem.BaseMask; row["basePermissions"] = taskItem.BasePermissions;
row["everyonePermissions"] = taskItem.EveryoneMask; row["everyonePermissions"] = taskItem.EveryonePermissions;
row["groupPermissions"] = taskItem.GroupMask; row["groupPermissions"] = taskItem.GroupPermissions;
// row["flags"] = taskItem.Flags; // row["flags"] = taskItem.Flags;
} }

View File

@ -1258,11 +1258,11 @@ namespace OpenSim.Data.MySQL
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]); taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
taskItem.GroupID = new LLUUID((String)row["groupID"]); taskItem.GroupID = new LLUUID((String)row["groupID"]);
taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]); taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]); taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]); taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]); taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]); taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]);
taskItem.Flags = Convert.ToUInt32(row["flags"]); taskItem.Flags = Convert.ToUInt32(row["flags"]);
return taskItem; return taskItem;
@ -1519,11 +1519,11 @@ namespace OpenSim.Data.MySQL
row["ownerID"] = taskItem.OwnerID; row["ownerID"] = taskItem.OwnerID;
row["lastOwnerID"] = taskItem.LastOwnerID; row["lastOwnerID"] = taskItem.LastOwnerID;
row["groupID"] = taskItem.GroupID; row["groupID"] = taskItem.GroupID;
row["nextPermissions"] = taskItem.NextOwnerMask; row["nextPermissions"] = taskItem.NextPermissions;
row["currentPermissions"] = taskItem.OwnerMask; row["currentPermissions"] = taskItem.CurrentPermissions;
row["basePermissions"] = taskItem.BaseMask; row["basePermissions"] = taskItem.BasePermissions;
row["everyonePermissions"] = taskItem.EveryoneMask; row["everyonePermissions"] = taskItem.EveryonePermissions;
row["groupPermissions"] = taskItem.GroupMask; row["groupPermissions"] = taskItem.GroupPermissions;
row["flags"] = taskItem.Flags; row["flags"] = taskItem.Flags;
} }

View File

@ -110,4 +110,21 @@
</id> </id>
<property name="Map" type="System.Byte[]" /> <property name="Map" type="System.Byte[]" />
</class> </class>
<class name="OpenSim.Framework.TaskInventoryItem, OpenSim.Framework" table="PrimItems" lazy="false">
<id name="ItemID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate">
<generator class="assigned" />
</id>
<property name="PrimID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="AssetID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="ParentFolderID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="CreatorID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="OwnerID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="GroupID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="LastOwnerID" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"/>
<property name="CurrentPermissions" type="System.UInt32" />
<property name="BasePermissions" type="System.UInt32" />
<property name="EveryonePermissions" type="System.UInt32" />
<property name="GroupPermissions" type="System.UInt32" />
<property name="NextPermissions" type="System.UInt32" />
</class>
</hibernate-mapping> </hibernate-mapping>

View File

@ -1014,11 +1014,11 @@ namespace OpenSim.Data.SQLite
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]); taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
taskItem.GroupID = new LLUUID((String)row["groupID"]); taskItem.GroupID = new LLUUID((String)row["groupID"]);
taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]); taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]); taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]); taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]); taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]); taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]);
taskItem.Flags = Convert.ToUInt32(row["flags"]); taskItem.Flags = Convert.ToUInt32(row["flags"]);
return taskItem; return taskItem;
@ -1254,11 +1254,11 @@ namespace OpenSim.Data.SQLite
row["ownerID"] = taskItem.OwnerID; row["ownerID"] = taskItem.OwnerID;
row["lastOwnerID"] = taskItem.LastOwnerID; row["lastOwnerID"] = taskItem.LastOwnerID;
row["groupID"] = taskItem.GroupID; row["groupID"] = taskItem.GroupID;
row["nextPermissions"] = taskItem.NextOwnerMask; row["nextPermissions"] = taskItem.NextPermissions;
row["currentPermissions"] = taskItem.OwnerMask; row["currentPermissions"] = taskItem.CurrentPermissions;
row["basePermissions"] = taskItem.BaseMask; row["basePermissions"] = taskItem.BasePermissions;
row["everyonePermissions"] = taskItem.EveryoneMask; row["everyonePermissions"] = taskItem.EveryonePermissions;
row["groupPermissions"] = taskItem.GroupMask; row["groupPermissions"] = taskItem.GroupPermissions;
row["flags"] = taskItem.Flags; row["flags"] = taskItem.Flags;
} }

View File

@ -236,7 +236,7 @@ namespace OpenSim.Framework
} }
} }
public uint BaseMask { public uint BasePermissions {
get { get {
return _baseMask; return _baseMask;
} }
@ -272,7 +272,7 @@ namespace OpenSim.Framework
} }
} }
public uint EveryoneMask { public uint EveryonePermissions {
get { get {
return _everyoneMask; return _everyoneMask;
} }
@ -299,7 +299,7 @@ namespace OpenSim.Framework
} }
} }
public uint GroupMask { public uint GroupPermissions {
get { get {
return _groupMask; return _groupMask;
} }
@ -344,7 +344,7 @@ namespace OpenSim.Framework
} }
} }
public uint NextOwnerMask { public uint NextPermissions {
get { get {
return _nextOwnerMask; return _nextOwnerMask;
} }
@ -362,7 +362,7 @@ namespace OpenSim.Framework
} }
} }
public uint OwnerMask { public uint CurrentPermissions {
get { get {
return _ownerMask; return _ownerMask;
} }

View File

@ -4756,7 +4756,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (ti.OwnerID != AgentId) if (ti.OwnerID != AgentId)
break; break;
if ((ti.OwnerMask & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
break; break;
if (ti.AssetID != requestID) if (ti.AssetID != requestID)
@ -5103,11 +5103,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
newTaskItem.CreatorID = updatetask.InventoryData.CreatorID; newTaskItem.CreatorID = updatetask.InventoryData.CreatorID;
newTaskItem.OwnerID = updatetask.InventoryData.OwnerID; newTaskItem.OwnerID = updatetask.InventoryData.OwnerID;
newTaskItem.GroupID = updatetask.InventoryData.GroupID; newTaskItem.GroupID = updatetask.InventoryData.GroupID;
newTaskItem.BaseMask = updatetask.InventoryData.BaseMask; newTaskItem.BasePermissions = updatetask.InventoryData.BaseMask;
newTaskItem.OwnerMask = updatetask.InventoryData.OwnerMask; newTaskItem.CurrentPermissions = updatetask.InventoryData.OwnerMask;
newTaskItem.GroupMask = updatetask.InventoryData.GroupMask; newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask;
newTaskItem.EveryoneMask = updatetask.InventoryData.EveryoneMask; newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask;
newTaskItem.NextOwnerMask = updatetask.InventoryData.NextOwnerMask; newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask;
//newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned;
newTaskItem.Type = updatetask.InventoryData.Type; newTaskItem.Type = updatetask.InventoryData.Type;
newTaskItem.InvType = updatetask.InventoryData.InvType; newTaskItem.InvType = updatetask.InventoryData.InvType;

View File

@ -919,22 +919,22 @@ namespace OpenSim.Region.Environment.Scenes
if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
{ {
agentItem.BasePermissions = taskItem.NextOwnerMask; agentItem.BasePermissions = taskItem.NextPermissions;
agentItem.CurrentPermissions = taskItem.NextOwnerMask; agentItem.CurrentPermissions = taskItem.NextPermissions;
agentItem.NextPermissions = taskItem.NextOwnerMask; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
} }
else else
{ {
agentItem.BasePermissions = taskItem.BaseMask; agentItem.BasePermissions = taskItem.BasePermissions;
agentItem.CurrentPermissions = taskItem.OwnerMask; agentItem.CurrentPermissions = taskItem.CurrentPermissions;
agentItem.NextPermissions = taskItem.NextOwnerMask; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryoneMask; agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
} }
if (!ExternalChecks.ExternalChecksBypassPermissions()) if (!ExternalChecks.ExternalChecksBypassPermissions())
{ {
if ((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId); part.RemoveInventoryItem(itemId);
} }
@ -1083,26 +1083,26 @@ namespace OpenSim.Region.Environment.Scenes
destTaskItem.ParentID = destPart.UUID; destTaskItem.ParentID = destPart.UUID;
destTaskItem.ParentPartID = destPart.UUID; destTaskItem.ParentPartID = destPart.UUID;
destTaskItem.BaseMask = srcTaskItem.BaseMask; destTaskItem.BasePermissions = srcTaskItem.BasePermissions;
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions;
destTaskItem.GroupMask = srcTaskItem.GroupMask; destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions;
destTaskItem.OwnerMask = srcTaskItem.OwnerMask; destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions;
destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask; destTaskItem.NextPermissions = srcTaskItem.NextPermissions;
destTaskItem.Flags = srcTaskItem.Flags; destTaskItem.Flags = srcTaskItem.Flags;
if (destPart.OwnerID != part.OwnerID) if (destPart.OwnerID != part.OwnerID)
{ {
if (ExternalChecks.ExternalChecksPropagatePermissions()) if (ExternalChecks.ExternalChecksPropagatePermissions())
{ {
destTaskItem.OwnerMask = srcTaskItem.OwnerMask & destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.GroupMask = srcTaskItem.GroupMask & destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask & destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.BaseMask = srcTaskItem.BaseMask & destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.OwnerMask |= 8; // Slam! destTaskItem.CurrentPermissions |= 8; // Slam!
} }
} }
@ -1113,7 +1113,7 @@ namespace OpenSim.Region.Environment.Scenes
destPart.AddInventoryItem(destTaskItem); destPart.AddInventoryItem(destTaskItem);
if ((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId); part.RemoveInventoryItem(itemId);
ScenePresence avatar; ScenePresence avatar;
@ -1331,12 +1331,12 @@ namespace OpenSim.Region.Environment.Scenes
taskItem.InvType = itemBase.InvType; taskItem.InvType = itemBase.InvType;
taskItem.OwnerID = itemBase.Owner; taskItem.OwnerID = itemBase.Owner;
taskItem.CreatorID = itemBase.Creator; taskItem.CreatorID = itemBase.Creator;
taskItem.BaseMask = itemBase.BasePermissions; taskItem.BasePermissions = itemBase.BasePermissions;
taskItem.OwnerMask = itemBase.CurrentPermissions; taskItem.CurrentPermissions = itemBase.CurrentPermissions;
taskItem.EveryoneMask = itemBase.EveryOnePermissions; taskItem.EveryonePermissions = itemBase.EveryOnePermissions;
taskItem.NextOwnerMask = itemBase.NextPermissions; taskItem.NextPermissions = itemBase.NextPermissions;
taskItem.GroupID = itemBase.GroupID; taskItem.GroupID = itemBase.GroupID;
taskItem.GroupMask = 0; taskItem.GroupPermissions = 0;
taskItem.Flags = itemBase.Flags; taskItem.Flags = itemBase.Flags;
taskItem.PermsGranter = LLUUID.Zero; taskItem.PermsGranter = LLUUID.Zero;
taskItem.PermsMask = 0; taskItem.PermsMask = 0;
@ -1409,26 +1409,26 @@ namespace OpenSim.Region.Environment.Scenes
destTaskItem.ParentID = destPart.UUID; destTaskItem.ParentID = destPart.UUID;
destTaskItem.ParentPartID = destPart.UUID; destTaskItem.ParentPartID = destPart.UUID;
destTaskItem.BaseMask = srcTaskItem.BaseMask; destTaskItem.BasePermissions = srcTaskItem.BasePermissions;
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions;
destTaskItem.GroupMask = srcTaskItem.GroupMask; destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions;
destTaskItem.OwnerMask = srcTaskItem.OwnerMask; destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions;
destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask; destTaskItem.NextPermissions = srcTaskItem.NextPermissions;
destTaskItem.Flags = srcTaskItem.Flags; destTaskItem.Flags = srcTaskItem.Flags;
if (destPart.OwnerID != srcPart.OwnerID) if (destPart.OwnerID != srcPart.OwnerID)
{ {
if (ExternalChecks.ExternalChecksPropagatePermissions()) if (ExternalChecks.ExternalChecksPropagatePermissions())
{ {
destTaskItem.OwnerMask = srcTaskItem.OwnerMask & destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.GroupMask = srcTaskItem.GroupMask & destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask & destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.BaseMask = srcTaskItem.BaseMask & destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
srcTaskItem.NextOwnerMask; srcTaskItem.NextPermissions;
destTaskItem.OwnerMask |= 8; // Slam! destTaskItem.CurrentPermissions |= 8; // Slam!
} }
} }
@ -2088,12 +2088,12 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (ExternalChecks.ExternalChecksPropagatePermissions()) if (ExternalChecks.ExternalChecksPropagatePermissions())
{ {
if ((item.OwnerMask & 8) != 0) if ((item.CurrentPermissions & 8) != 0)
{ {
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
part.EveryoneMask = item.EveryoneMask; part.EveryoneMask = item.EveryonePermissions;
part.NextOwnerMask = item.NextOwnerMask; part.NextOwnerMask = item.NextPermissions;
} }
} }
group.ApplyNextOwnerPermissions(); group.ApplyNextOwnerPermissions();
@ -2108,10 +2108,10 @@ namespace OpenSim.Region.Environment.Scenes
part.OwnerID = item.OwnerID; part.OwnerID = item.OwnerID;
part.ChangeInventoryOwner(item.OwnerID); part.ChangeInventoryOwner(item.OwnerID);
} }
else if ((item.OwnerMask & 8) != 0) // Slam! else if ((item.CurrentPermissions & 8) != 0) // Slam!
{ {
part.EveryoneMask = item.EveryoneMask; part.EveryoneMask = item.EveryonePermissions;
part.NextOwnerMask = item.NextOwnerMask; part.NextOwnerMask = item.NextPermissions;
} }
} }
rootPart.TrimPermissions(); rootPart.TrimPermissions();
@ -2127,7 +2127,7 @@ namespace OpenSim.Region.Environment.Scenes
if (!ExternalChecks.ExternalChecksBypassPermissions()) if (!ExternalChecks.ExternalChecksBypassPermissions())
{ {
if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
sourcePart.RemoveInventoryItem(item.ItemID); sourcePart.RemoveInventoryItem(item.ItemID);
} }
return rootPart.ParentGroup; return rootPart.ParentGroup;

View File

@ -151,11 +151,11 @@ namespace OpenSim.Region.Environment.Scenes
taskItem.Type = item.AssetType; taskItem.Type = item.AssetType;
taskItem.InvType = item.InvType; taskItem.InvType = item.InvType;
taskItem.BaseMask = item.BasePermissions; taskItem.BasePermissions = item.BasePermissions;
taskItem.OwnerMask = item.CurrentPermissions; taskItem.CurrentPermissions = item.CurrentPermissions;
// FIXME: ignoring group permissions for now as they aren't stored in item // FIXME: ignoring group permissions for now as they aren't stored in item
taskItem.EveryoneMask = item.EveryOnePermissions; taskItem.EveryonePermissions = item.EveryOnePermissions;
taskItem.NextOwnerMask = item.NextPermissions; taskItem.NextPermissions = item.NextPermissions;
taskItem.Flags = item.Flags; taskItem.Flags = item.Flags;
// TODO: These are pending addition of those fields to TaskInventoryItem // TODO: These are pending addition of those fields to TaskInventoryItem
// taskItem.SalePrice = item.SalePrice; // taskItem.SalePrice = item.SalePrice;

View File

@ -526,8 +526,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
LLUUID ownerID = item.OwnerID; LLUUID ownerID = item.OwnerID;
uint everyoneMask = 0; uint everyoneMask = 0;
uint baseMask = item.BaseMask; uint baseMask = item.BasePermissions;
uint ownerMask = item.OwnerMask; uint ownerMask = item.CurrentPermissions;
if (item.InvType == 10) // Script if (item.InvType == 10) // Script
{ {
@ -557,7 +557,7 @@ namespace OpenSim.Region.Environment.Scenes
invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask)); invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0)); invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0));
invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask)); invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask)); invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextPermissions));
invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
invString.AddNameValueLine("owner_id", ownerID.ToString()); invString.AddNameValueLine("owner_id", ownerID.ToString());
@ -680,28 +680,28 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (item.InvType != 6) if (item.InvType != 6)
{ {
if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0) if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13); mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13); mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0) if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13); mask &= ~((uint)PermissionMask.Modify >> 13);
} }
else else
{ {
if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13); mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13); mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13); mask &= ~((uint)PermissionMask.Modify >> 13);
} }
if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy; mask &= ~(uint)PermissionMask.Copy;
if ((item.OwnerMask & (uint)PermissionMask.Transfer) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer; mask &= ~(uint)PermissionMask.Transfer;
if ((item.OwnerMask & (uint)PermissionMask.Modify) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~(uint)PermissionMask.Modify; mask &= ~(uint)PermissionMask.Modify;
} }
return mask; return mask;
@ -717,16 +717,16 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (item.InvType == 6) if (item.InvType == 6)
{ {
if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Copy; item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Transfer; item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
item.OwnerMask &= ~(uint)PermissionMask.Modify; item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
} }
item.OwnerMask &= item.NextOwnerMask; item.CurrentPermissions &= item.NextPermissions;
item.BaseMask &= item.NextOwnerMask; item.BasePermissions &= item.NextPermissions;
item.EveryoneMask &= item.NextOwnerMask; item.EveryonePermissions &= item.NextPermissions;
} }
TriggerScriptChangedEvent(Changed.OWNER); TriggerScriptChangedEvent(Changed.OWNER);

View File

@ -3361,7 +3361,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
if (inv.Value.Name == name) if (inv.Value.Name == name)
{ {
if ((inv.Value.OwnerMask & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) if ((inv.Value.CurrentPermissions & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
{ {
return inv.Value.AssetID.ToString(); return inv.Value.AssetID.ToString();
} }
@ -6508,15 +6508,15 @@ namespace OpenSim.Region.ScriptEngine.Common
switch (mask) switch (mask)
{ {
case 0: case 0:
return (int)inv.Value.BaseMask; return (int)inv.Value.BasePermissions;
case 1: case 1:
return (int)inv.Value.OwnerMask; return (int)inv.Value.CurrentPermissions;
case 2: case 2:
return (int)inv.Value.GroupMask; return (int)inv.Value.GroupPermissions;
case 3: case 3:
return (int)inv.Value.EveryoneMask; return (int)inv.Value.EveryonePermissions;
case 4: case 4:
return (int)inv.Value.NextOwnerMask; return (int)inv.Value.NextPermissions;
} }
} }
} }

View File

@ -3302,7 +3302,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
if (inv.Value.Name == name) if (inv.Value.Name == name)
{ {
if ((inv.Value.OwnerMask & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) if ((inv.Value.CurrentPermissions & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
{ {
return inv.Value.AssetID.ToString(); return inv.Value.AssetID.ToString();
} }
@ -6287,15 +6287,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
switch (mask) switch (mask)
{ {
case 0: case 0:
return (int)inv.Value.BaseMask; return (int)inv.Value.BasePermissions;
case 1: case 1:
return (int)inv.Value.OwnerMask; return (int)inv.Value.CurrentPermissions;
case 2: case 2:
return (int)inv.Value.GroupMask; return (int)inv.Value.GroupPermissions;
case 3: case 3:
return (int)inv.Value.EveryoneMask; return (int)inv.Value.EveryonePermissions;
case 4: case 4:
return (int)inv.Value.NextOwnerMask; return (int)inv.Value.NextPermissions;
} }
} }
} }