mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 10:46:00 +08:00
Refactor: Scene.ExternalChecks -> Scene.Permissions. Also make all
the internals of the permissions module adapter sane
This commit is contained in:
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
userInfo.AddItem(item);
|
||||
|
||||
int userlevel = 0;
|
||||
if (ExternalChecks.ExternalChecksCanBeGodLike(AgentID))
|
||||
if (Permissions.IsGod(AgentID))
|
||||
{
|
||||
userlevel = 1;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if ((InventoryType) item.InvType == InventoryType.Notecard)
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksCanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId))
|
||||
if (!Permissions.CanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
|
||||
return UUID.Zero;
|
||||
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
else if ((InventoryType) item.InvType == InventoryType.LSL)
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksCanEditScript(itemID, UUID.Zero, remoteClient.AgentId))
|
||||
if (!Permissions.CanEditScript(itemID, UUID.Zero, remoteClient.AgentId))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
|
||||
return UUID.Zero;
|
||||
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId,
|
||||
UUID primId, bool isScriptRunning, byte[] data)
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksCanEditScript(itemId, primId, remoteClient.AgentId))
|
||||
if (!Permissions.CanEditScript(itemId, primId, remoteClient.AgentId))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
|
||||
return;
|
||||
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
|
||||
return null;
|
||||
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
itemCopy.AssetType = item.AssetType;
|
||||
itemCopy.InvType = item.InvType;
|
||||
itemCopy.Folder = UUID.Zero;
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
if (item.InvType == 6)
|
||||
{
|
||||
@@ -500,7 +500,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
recipientUserInfo.AddItem(itemCopy);
|
||||
|
||||
if (!ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
senderUserInfo.DeleteItem(itemId);
|
||||
@@ -764,7 +764,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
|
||||
|
||||
if (!ExternalChecks.ExternalChecksCanCreateUserInventory(invType, remoteClient.AgentId))
|
||||
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
if (transactionID == UUID.Zero)
|
||||
@@ -975,7 +975,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
agentItem.InvType = taskItem.InvType;
|
||||
agentItem.Flags = taskItem.Flags;
|
||||
|
||||
if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if ((destAgent != taskItem.OwnerID) && Permissions.PropagatePermissions())
|
||||
{
|
||||
agentItem.BasePermissions = taskItem.NextPermissions;
|
||||
agentItem.CurrentPermissions = taskItem.NextPermissions | 8;
|
||||
@@ -992,7 +992,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
agentItem.GroupPermissions = taskItem.GroupPermissions;
|
||||
}
|
||||
|
||||
if (!ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!Permissions.BypassPermissions())
|
||||
{
|
||||
if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
part.Inventory.RemoveInventoryItem(itemId);
|
||||
@@ -1165,7 +1165,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (destPart.OwnerID != part.OwnerID)
|
||||
{
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
|
||||
srcTaskItem.NextPermissions;
|
||||
@@ -1262,7 +1262,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// AllowInventoryDrop flag has been set. Don't however let
|
||||
// them update an item unless they pass the external checks
|
||||
//
|
||||
if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId)
|
||||
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)
|
||||
&& (currentItem != null || !allowInventoryDrop))
|
||||
return;
|
||||
|
||||
@@ -1291,7 +1291,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
|
||||
item.Name, primLocalID, remoteClient.Name);
|
||||
part.GetProperties(remoteClient);
|
||||
if (!ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
RemoveInventoryItem(remoteClient, itemID);
|
||||
@@ -1358,7 +1358,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part != null)
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId))
|
||||
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
|
||||
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||
return;
|
||||
|
||||
if (!ExternalChecks.ExternalChecksCanCreateObjectInventory(
|
||||
if (!Permissions.CanCreateObjectInventory(
|
||||
itemBase.InvType, part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
@@ -1506,7 +1506,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (destPart.OwnerID != srcPart.OwnerID)
|
||||
{
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
|
||||
srcTaskItem.NextPermissions;
|
||||
@@ -1567,20 +1567,20 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (destination == 1) // Take Copy
|
||||
{
|
||||
permissionToTake =
|
||||
ExternalChecks.ExternalChecksCanTakeCopyObject(
|
||||
Permissions.CanTakeCopyObject(
|
||||
grp.UUID,
|
||||
remoteClient.AgentId);
|
||||
}
|
||||
else if (destination == 5) // God take copy
|
||||
{
|
||||
permissionToTake =
|
||||
ExternalChecks.ExternalChecksCanBeGodLike(
|
||||
Permissions.IsGod(
|
||||
remoteClient.AgentId);
|
||||
}
|
||||
else if (destination == 4) // Take
|
||||
{
|
||||
permissionToTake =
|
||||
ExternalChecks.ExternalChecksCanTakeObject(
|
||||
Permissions.CanTakeObject(
|
||||
grp.UUID,
|
||||
remoteClient.AgentId);
|
||||
|
||||
@@ -1590,11 +1590,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
else if (destination == 6) //Delete
|
||||
{
|
||||
permissionToTake =
|
||||
ExternalChecks.ExternalChecksCanDeleteObject(
|
||||
Permissions.CanDeleteObject(
|
||||
grp.UUID,
|
||||
remoteClient.AgentId);
|
||||
permissionToDelete =
|
||||
ExternalChecks.ExternalChecksCanDeleteObject(
|
||||
Permissions.CanDeleteObject(
|
||||
grp.UUID,
|
||||
remoteClient.AgentId);
|
||||
}
|
||||
@@ -1603,11 +1603,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (remoteClient != null)
|
||||
{
|
||||
permissionToTake =
|
||||
ExternalChecks.ExternalChecksCanDeleteObject(
|
||||
Permissions.CanDeleteObject(
|
||||
grp.UUID,
|
||||
remoteClient.AgentId);
|
||||
permissionToDelete =
|
||||
ExternalChecks.ExternalChecksCanDeleteObject(
|
||||
Permissions.CanDeleteObject(
|
||||
grp.UUID,
|
||||
remoteClient.AgentId);
|
||||
if (permissionToDelete)
|
||||
@@ -1722,7 +1722,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
item.Folder = folderID;
|
||||
|
||||
if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions())
|
||||
{
|
||||
uint perms=objectGroup.GetEffectivePermissions();
|
||||
uint nextPerms=(perms & 7) << 13;
|
||||
@@ -1877,7 +1877,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
item.Folder = UUID.Zero; // Objects folder!
|
||||
|
||||
if ((remoteClient.AgentId != grp.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions())
|
||||
{
|
||||
item.BasePermissions = grp.RootPart.NextOwnerMask;
|
||||
item.CurrentPermissions = grp.RootPart.NextOwnerMask;
|
||||
@@ -1988,7 +1988,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
string xmlData = Utils.BytesToString(rezAsset.Data);
|
||||
SceneObjectGroup group = new SceneObjectGroup(xmlData, true);
|
||||
if (!ExternalChecks.ExternalChecksCanRezObject(
|
||||
if (!Permissions.CanRezObject(
|
||||
group.Children.Count, remoteClient.AgentId, pos)
|
||||
&& !attachment)
|
||||
{
|
||||
@@ -2043,7 +2043,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
rootPart.ObjectSaleType = 0;
|
||||
rootPart.SalePrice = 10;
|
||||
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & 8) != 0)
|
||||
{
|
||||
@@ -2093,7 +2093,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (!attachment)
|
||||
rootPart.ScheduleFullUpdate();
|
||||
|
||||
if (!ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
userInfo.DeleteItem(item.ID);
|
||||
@@ -2133,7 +2133,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
string xmlData = Utils.BytesToString(rezAsset.Data);
|
||||
SceneObjectGroup group = new SceneObjectGroup(xmlData, true);
|
||||
|
||||
if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos))
|
||||
if (!Permissions.CanRezObject(group.Children.Count, ownerID, pos))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -2158,7 +2158,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (rootPart.OwnerID != item.OwnerID)
|
||||
{
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & 8) != 0)
|
||||
{
|
||||
@@ -2197,7 +2197,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
group.CreateScriptInstances(param, true, DefaultScriptEngine, 2);
|
||||
rootPart.ScheduleFullUpdate();
|
||||
|
||||
if (!ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
sourcePart.Inventory.RemoveInventoryItem(item.ItemID);
|
||||
@@ -2315,7 +2315,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
ScenePresence presence;
|
||||
if (TryGetAvatar(remoteClient.AgentId, out presence))
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksCanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition))
|
||||
if (!Permissions.CanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition))
|
||||
return;
|
||||
|
||||
presence.Appearance.DetachAttachment(itemID);
|
||||
@@ -2359,7 +2359,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> localIDs)
|
||||
{
|
||||
if (!ExternalChecks.ExternalChecksCanBeGodLike(remoteClient.AgentId))
|
||||
if (!Permissions.IsGod(remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
foreach (uint localID in localIDs)
|
||||
|
||||
@@ -113,8 +113,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
((SceneObjectGroup) ent).GetProperties(remoteClient);
|
||||
((SceneObjectGroup) ent).IsSelected = true;
|
||||
// A prim is only tainted if it's allowed to be edited by the person clicking it.
|
||||
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|
||||
|| ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
|
||||
if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|
||||
|| Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
|
||||
{
|
||||
EventManager.TriggerParcelPrimCountTainted();
|
||||
}
|
||||
@@ -181,9 +181,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
//
|
||||
if (!isAttachment)
|
||||
{
|
||||
if (ExternalChecks.ExternalChecksCanEditObject(
|
||||
if (Permissions.CanEditObject(
|
||||
part.UUID, remoteClient.AgentId)
|
||||
|| ExternalChecks.ExternalChecksCanMoveObject(
|
||||
|| Permissions.CanMoveObject(
|
||||
part.UUID, remoteClient.AgentId))
|
||||
EventManager.TriggerParcelPrimCountTainted();
|
||||
}
|
||||
@@ -337,7 +337,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (part == null)
|
||||
return;
|
||||
|
||||
if (ExternalChecks.ExternalChecksCanResetScript(itemID, remoteClient.AgentId))
|
||||
if (Permissions.CanResetScript(itemID, remoteClient.AgentId))
|
||||
{
|
||||
EventManager.TriggerScriptReset(part.LocalId, itemID);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -293,7 +293,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor;
|
||||
|
||||
m_eventManager = new EventManager();
|
||||
m_externalChecks = new SceneExternalChecks(this);
|
||||
m_permissions = new ScenePermissions(this);
|
||||
|
||||
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
|
||||
m_asyncSceneObjectDeleter.Enabled = true;
|
||||
@@ -1750,7 +1750,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false);
|
||||
|
||||
if (ExternalChecks.ExternalChecksCanRezObject(1, ownerID, pos))
|
||||
if (Permissions.CanRezObject(1, ownerID, pos))
|
||||
{
|
||||
// rez ON the ground, not IN the ground
|
||||
pos.Z += 0.25F;
|
||||
@@ -3450,7 +3450,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
|
||||
// First check that this is the sim owner
|
||||
if (ExternalChecks.ExternalChecksCanBeGodLike(agentID))
|
||||
if (Permissions.IsGod(agentID))
|
||||
{
|
||||
// Next we check for spoofing.....
|
||||
UUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId;
|
||||
@@ -3527,7 +3527,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID)
|
||||
{
|
||||
if (ExternalChecks.ExternalChecksCanBeGodLike(godID))
|
||||
if (Permissions.IsGod(godID))
|
||||
{
|
||||
if (agentID == kickUserID)
|
||||
{
|
||||
@@ -3848,7 +3848,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
else if ((parcel.landData.Flags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0)
|
||||
{
|
||||
if (part.OwnerID == parcel.landData.OwnerID || (parcel.landData.IsGroupOwned && part.GroupID == parcel.landData.GroupID) || ExternalChecks.ExternalChecksCanBeGodLike(part.OwnerID))
|
||||
if (part.OwnerID == parcel.landData.OwnerID || (parcel.landData.IsGroupOwned && part.GroupID == parcel.landData.GroupID) || Permissions.IsGod(part.OwnerID))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -4273,7 +4273,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
List<SceneObjectPart> partList =
|
||||
new List<SceneObjectPart>(group.Children.Values);
|
||||
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
if (Permissions.PropagatePermissions())
|
||||
{
|
||||
foreach (SceneObjectPart child in partList)
|
||||
{
|
||||
|
||||
@@ -84,10 +84,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
|
||||
|
||||
protected SceneExternalChecks m_externalChecks;
|
||||
public SceneExternalChecks ExternalChecks
|
||||
protected ScenePermissions m_permissions;
|
||||
public ScenePermissions Permissions
|
||||
{
|
||||
get { return m_externalChecks; }
|
||||
get { return m_permissions; }
|
||||
}
|
||||
|
||||
protected string m_datastore;
|
||||
|
||||
@@ -599,7 +599,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
public virtual void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, Vector3 position,
|
||||
Vector3 lookAt, uint teleportFlags)
|
||||
{
|
||||
if (!avatar.Scene.ExternalChecks.ExternalChecksCanTeleport(avatar.UUID))
|
||||
if (!avatar.Scene.Permissions.CanTeleport(avatar.UUID))
|
||||
return;
|
||||
|
||||
bool destRegionUp = false;
|
||||
|
||||
@@ -431,7 +431,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
SceneObjectGroup group = (SceneObjectGroup)obj;
|
||||
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
group.SetGroup(GroupID, remoteClient);
|
||||
else
|
||||
remoteClient.SendAgentAlertMessage("You don't have permission to set the group", false);
|
||||
@@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (part == null)
|
||||
return;
|
||||
|
||||
if (!m_parentScene.ExternalChecks.ExternalChecksCanTakeObject(
|
||||
if (!m_parentScene.Permissions.CanTakeObject(
|
||||
part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
@@ -522,7 +522,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (((SceneObjectGroup)obj).LocalId == objectLocalID)
|
||||
{
|
||||
SceneObjectGroup group = (SceneObjectGroup)obj;
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanTakeObject(obj.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanTakeObject(obj.UUID, remoteClient.AgentId))
|
||||
{
|
||||
// If the attachment point isn't the same as the one previously used
|
||||
// set it's offset position = 0 so that it appears on the attachment point
|
||||
@@ -1056,7 +1056,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.Resize(scale, localID);
|
||||
}
|
||||
@@ -1068,7 +1068,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.GroupResize(scale, localID);
|
||||
}
|
||||
@@ -1104,7 +1104,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.UpdateSingleRotation(rot, localID);
|
||||
}
|
||||
@@ -1122,7 +1122,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.UpdateGroupRotation(rot);
|
||||
}
|
||||
@@ -1141,7 +1141,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.UpdateGroupRotation(pos, rot);
|
||||
}
|
||||
@@ -1159,7 +1159,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment)
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment)
|
||||
{
|
||||
group.UpdateSinglePosition(pos, localID);
|
||||
}
|
||||
@@ -1185,7 +1185,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment)
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment)
|
||||
{
|
||||
group.UpdateGroupPosition(pos);
|
||||
}
|
||||
@@ -1204,7 +1204,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID,remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId))
|
||||
{
|
||||
group.UpdateTextureEntry(localID, texture);
|
||||
}
|
||||
@@ -1222,7 +1222,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.UpdatePrimFlags(localID, UsePhysics, IsTemporary, IsPhantom);
|
||||
}
|
||||
@@ -1241,7 +1241,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(objectID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
|
||||
{
|
||||
group.GrabMovement(offset, pos, remoteClient);
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.SetPartName(Util.CleanString(name), primLocalID);
|
||||
group.HasGroupChanged = true;
|
||||
@@ -1281,7 +1281,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
group.SetPartDescription(Util.CleanString(description), primLocalID);
|
||||
group.HasGroupChanged = true;
|
||||
@@ -1294,7 +1294,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
||||
part.ClickAction = Convert.ToByte(clickAction);
|
||||
@@ -1308,7 +1308,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
||||
part.Material = Convert.ToByte(material);
|
||||
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID,agentID))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID))
|
||||
{
|
||||
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
||||
}
|
||||
@@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.GetPartsFullID(primLocalID), agentID))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID))
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
|
||||
shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
|
||||
@@ -1612,12 +1612,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// libomv will complain about PrimFlags.JointWheel being
|
||||
// deprecated, so we
|
||||
#pragma warning disable 0612
|
||||
if (IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanEditObject(objid, user))
|
||||
if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(objid, user))
|
||||
{
|
||||
obj.ParentGroup.RootPart.AddFlag(PrimFlags.JointWheel);
|
||||
obj.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
else if (!IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(objid,user))
|
||||
else if (!IncludeInSearch && m_parentScene.Permissions.CanMoveObject(objid,user))
|
||||
{
|
||||
obj.ParentGroup.RootPart.RemFlag(PrimFlags.JointWheel);
|
||||
obj.ParentGroup.HasGroupChanged = true;
|
||||
@@ -1665,7 +1665,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (originPrim != null)
|
||||
{
|
||||
if (m_parentScene.ExternalChecks.ExternalChecksCanDuplicateObject(originPrim.Children.Count, originPrim.UUID, AgentID, originPrim.AbsolutePosition))
|
||||
if (m_parentScene.Permissions.CanDuplicateObject(originPrim.Children.Count, originPrim.UUID, AgentID, originPrim.AbsolutePosition))
|
||||
{
|
||||
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID, true);
|
||||
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
|
||||
{
|
||||
ForEachCurrentScene(delegate(Scene scene) { scene.ExternalChecks.ExternalChecksSetBypassPermissions(bypassPermissions); });
|
||||
ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); });
|
||||
}
|
||||
|
||||
private void ForEachCurrentScene(Action<Scene> func)
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (remoteClient != null &&
|
||||
remoteClient.AgentId != part.OwnerID &&
|
||||
m_scene.ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
m_scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
taskItem.BasePermissions = item.BasePermissions &
|
||||
item.NextPermissions;
|
||||
|
||||
@@ -1277,14 +1277,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public void SendFullUpdateToClient(IClientAPI remoteClient)
|
||||
{
|
||||
SendPartFullUpdate(remoteClient, RootPart, m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
|
||||
SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
|
||||
|
||||
lock (m_parts)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
if (part != RootPart)
|
||||
SendPartFullUpdate(remoteClient, part, m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(remoteClient.AgentId, part.UUID));
|
||||
SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1493,7 +1493,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (part.OwnerID != cAgentID)
|
||||
{
|
||||
// Apply Next Owner Permissions if we're not bypassing permissions
|
||||
if (!m_scene.ExternalChecks.ExternalChecksBypassPermissions())
|
||||
if (!m_scene.Permissions.BypassPermissions())
|
||||
ApplyNextOwnerPermissions();
|
||||
}
|
||||
|
||||
|
||||
@@ -2997,7 +2997,7 @@ if (m_shape != null) {
|
||||
public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF)
|
||||
{
|
||||
bool set = addRemTF == 1;
|
||||
bool god = m_parentGroup.Scene.ExternalChecks.ExternalChecksCanBeGodLike(AgentID);
|
||||
bool god = m_parentGroup.Scene.Permissions.IsGod(AgentID);
|
||||
|
||||
uint baseMask = _baseMask;
|
||||
if (god)
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// "Starting script {0}, {1} in prim {2}, {3}",
|
||||
// item.Name, item.ItemID, Name, UUID);
|
||||
|
||||
if (!m_part.ParentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
||||
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
||||
return;
|
||||
|
||||
m_part.AddFlag(PrimFlags.Scripted);
|
||||
|
||||
@@ -577,7 +577,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public uint GenerateClientFlags(UUID ObjectID)
|
||||
{
|
||||
return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID);
|
||||
return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user