* refactor: rename object inventory permission checks to distinguish between task inventory and agent inventory
parent
ca35b49b70
commit
bf68255b86
|
@ -184,12 +184,11 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
m_scene.ExternalChecks.addCheckCanLinkObject(CanLinkObject); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanLinkObject(CanLinkObject); //NOT YET IMPLEMENTED
|
||||||
m_scene.ExternalChecks.addCheckCanDelinkObject(CanDelinkObject); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanDelinkObject(CanDelinkObject); //NOT YET IMPLEMENTED
|
||||||
m_scene.ExternalChecks.addCheckCanBuyLand(CanBuyLand); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanBuyLand(CanBuyLand); //NOT YET IMPLEMENTED
|
||||||
m_scene.ExternalChecks.addCheckCanCopyInventory(CanCopyInventory); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanCopyObjectInventory(CanCopyObjectInventory); //NOT YET IMPLEMENTED
|
||||||
m_scene.ExternalChecks.addCheckCanDeleteInventory(CanDeleteInventory); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanDeleteObjectInventory(CanDeleteObjectInventory); //NOT YET IMPLEMENTED
|
||||||
m_scene.ExternalChecks.addCheckCanCreateInventory(CanCreateInventory); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanCreateObjectInventory(CanCreateObjectInventory); //NOT YET IMPLEMENTED
|
||||||
m_scene.ExternalChecks.addCheckCanTeleport(CanTeleport); //NOT YET IMPLEMENTED
|
m_scene.ExternalChecks.addCheckCanTeleport(CanTeleport); //NOT YET IMPLEMENTED
|
||||||
|
|
||||||
|
|
||||||
//Register Debug Commands
|
//Register Debug Commands
|
||||||
Command bypassCommand = new Command("bypass", CommandIntentions.COMMAND_HAZARDOUS, InterfaceBypassPermissions, "Force the permissions a specific way to test permissions");
|
Command bypassCommand = new Command("bypass", CommandIntentions.COMMAND_HAZARDOUS, InterfaceBypassPermissions, "Force the permissions a specific way to test permissions");
|
||||||
bypassCommand.AddArgument("enable_bypass_perms", "true to enable bypassing all perms", "Boolean");
|
bypassCommand.AddArgument("enable_bypass_perms", "true to enable bypassing all perms", "Boolean");
|
||||||
|
@ -1202,7 +1201,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanCopyInventory(UUID itemID, UUID objectID, UUID userID)
|
public bool CanCopyObjectInventory(UUID itemID, UUID objectID, UUID userID)
|
||||||
{
|
{
|
||||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||||
|
@ -1210,7 +1209,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanDeleteInventory(UUID itemID, UUID objectID, UUID userID)
|
public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID)
|
||||||
{
|
{
|
||||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||||
|
@ -1227,7 +1226,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
/// <param name="objectID"></param>
|
/// <param name="objectID"></param>
|
||||||
/// <param name="userID"></param>
|
/// <param name="userID"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool CanCreateInventory(int invType, UUID objectID, UUID userID)
|
public bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID)
|
||||||
{
|
{
|
||||||
m_log.Debug("[PERMISSIONS]: CanCreateInventory called");
|
m_log.Debug("[PERMISSIONS]: CanCreateInventory called");
|
||||||
|
|
||||||
|
|
|
@ -1387,7 +1387,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ExternalChecks.ExternalChecksCanCreateInventory(itemBase.InvType, part.UUID, remoteClient.AgentId))
|
if (!ExternalChecks.ExternalChecksCanCreateObjectInventory(
|
||||||
|
itemBase.InvType, part.UUID, remoteClient.AgentId))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
|
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
|
||||||
|
|
|
@ -1070,51 +1070,63 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public delegate bool CanCreateInventory(int invType, UUID objectID, UUID userID);
|
public delegate bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID);
|
||||||
private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>();
|
private List<CanCreateObjectInventory> CanCreateObjectInventoryCheckFunctions
|
||||||
|
= new List<CanCreateObjectInventory>();
|
||||||
|
|
||||||
public void addCheckCanCreateInventory(CanCreateInventory delegateFunc)
|
|
||||||
|
public void addCheckCanCreateObjectInventory(CanCreateObjectInventory delegateFunc)
|
||||||
{
|
{
|
||||||
if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc))
|
if (!CanCreateObjectInventoryCheckFunctions.Contains(delegateFunc))
|
||||||
CanCreateInventoryCheckFunctions.Add(delegateFunc);
|
CanCreateObjectInventoryCheckFunctions.Add(delegateFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc)
|
public void removeCheckCanCreateObjectInventory(CanCreateObjectInventory delegateFunc)
|
||||||
{
|
{
|
||||||
if (CanCreateInventoryCheckFunctions.Contains(delegateFunc))
|
if (CanCreateObjectInventoryCheckFunctions.Contains(delegateFunc))
|
||||||
CanCreateInventoryCheckFunctions.Remove(delegateFunc);
|
CanCreateObjectInventoryCheckFunctions.Remove(delegateFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ExternalChecksCanCreateInventory(int invType, UUID objectID, UUID userID)
|
/// <summary>
|
||||||
|
/// Check whether the specified user is allowed to directly create the given inventory type in a prim's
|
||||||
|
/// inventory (e.g. the New Script button in the 1.21 Linden Lab client). This permission check does not
|
||||||
|
/// apply to existing items that are being dragged in to that prim's inventory.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="invType"></param>
|
||||||
|
/// <param name="objectID"></param>
|
||||||
|
/// <param name="userID"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool ExternalChecksCanCreateObjectInventory(int invType, UUID objectID, UUID userID)
|
||||||
{
|
{
|
||||||
foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions)
|
foreach (CanCreateObjectInventory check in CanCreateObjectInventoryCheckFunctions)
|
||||||
{
|
{
|
||||||
if (check(invType, objectID, userID) == false)
|
if (check(invType, objectID, userID) == false)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate bool CanCopyInventory(UUID itemID, UUID objectID, UUID userID);
|
public delegate bool CanCopyObjectInventory(UUID itemID, UUID objectID, UUID userID);
|
||||||
private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>();
|
private List<CanCopyObjectInventory> CanCopyObjectInventoryCheckFunctions = new List<CanCopyObjectInventory>();
|
||||||
|
|
||||||
public void addCheckCanCopyInventory(CanCopyInventory delegateFunc)
|
public void addCheckCanCopyObjectInventory(CanCopyObjectInventory delegateFunc)
|
||||||
{
|
{
|
||||||
if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc))
|
if (!CanCopyObjectInventoryCheckFunctions.Contains(delegateFunc))
|
||||||
CanCopyInventoryCheckFunctions.Add(delegateFunc);
|
CanCopyObjectInventoryCheckFunctions.Add(delegateFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc)
|
public void removeCheckCanCopyObjectInventory(CanCopyObjectInventory delegateFunc)
|
||||||
{
|
{
|
||||||
if (CanCopyInventoryCheckFunctions.Contains(delegateFunc))
|
if (CanCopyObjectInventoryCheckFunctions.Contains(delegateFunc))
|
||||||
CanCopyInventoryCheckFunctions.Remove(delegateFunc);
|
CanCopyObjectInventoryCheckFunctions.Remove(delegateFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ExternalChecksCanCopyInventory(UUID itemID, UUID objectID, UUID userID)
|
public bool ExternalChecksCanCopyObjectInventory(UUID itemID, UUID objectID, UUID userID)
|
||||||
{
|
{
|
||||||
foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions)
|
foreach (CanCopyObjectInventory check in CanCopyObjectInventoryCheckFunctions)
|
||||||
{
|
{
|
||||||
if (check(itemID, objectID, userID) == false)
|
if (check(itemID, objectID, userID) == false)
|
||||||
{
|
{
|
||||||
|
@ -1124,30 +1136,32 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate bool CanDeleteInventory(UUID itemID, UUID objectID, UUID userID);
|
public delegate bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID);
|
||||||
private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>();
|
private List<CanDeleteObjectInventory> CanDeleteObjectInventoryCheckFunctions
|
||||||
|
= new List<CanDeleteObjectInventory>();
|
||||||
|
|
||||||
public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
|
public void addCheckCanDeleteObjectInventory(CanDeleteObjectInventory delegateFunc)
|
||||||
{
|
{
|
||||||
if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
|
if (!CanDeleteObjectInventoryCheckFunctions.Contains(delegateFunc))
|
||||||
CanDeleteInventoryCheckFunctions.Add(delegateFunc);
|
CanDeleteObjectInventoryCheckFunctions.Add(delegateFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
|
public void removeCheckCanDeleteObjectInventory(CanDeleteObjectInventory delegateFunc)
|
||||||
{
|
{
|
||||||
if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
|
if (CanDeleteObjectInventoryCheckFunctions.Contains(delegateFunc))
|
||||||
CanDeleteInventoryCheckFunctions.Remove(delegateFunc);
|
CanDeleteObjectInventoryCheckFunctions.Remove(delegateFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ExternalChecksCanDeleteInventory(UUID itemID, UUID objectID, UUID userID)
|
public bool ExternalChecksCanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID)
|
||||||
{
|
{
|
||||||
foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions)
|
foreach (CanDeleteObjectInventory check in CanDeleteObjectInventoryCheckFunctions)
|
||||||
{
|
{
|
||||||
if (check(itemID, objectID, userID) == false)
|
if (check(itemID, objectID, userID) == false)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue