Refactor script create permission into the perms module
parent
9cf8795ecf
commit
7229bc4fbd
|
@ -1780,10 +1780,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||||
|
|
||||||
if ((int)InventoryType.LSL == invType)
|
SceneObjectPart part = scene.GetSceneObjectPart(objectID);
|
||||||
if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID))
|
ScenePresence p = scene.GetScenePresence(userID);
|
||||||
return false;
|
|
||||||
|
if (part == null || p == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!IsAdministrator(userID))
|
||||||
|
{
|
||||||
|
if (part.OwnerID != userID)
|
||||||
|
{
|
||||||
|
// Group permissions
|
||||||
|
if ((part.GroupID == UUID.Zero) || (p.ControllingClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0))
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ((int)InventoryType.LSL == invType)
|
||||||
|
if (m_allowedScriptCreators == UserSet.Administrators)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1980,4 +1998,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1532,16 +1532,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (part == null)
|
if (part == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (part.OwnerID != remoteClient.AgentId)
|
|
||||||
{
|
|
||||||
// Group permissions
|
|
||||||
if ((part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0))
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Permissions.CanCreateObjectInventory(
|
if (!Permissions.CanCreateObjectInventory(
|
||||||
itemBase.InvType, part.UUID, remoteClient.AgentId))
|
itemBase.InvType, part.UUID, remoteClient.AgentId))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue