*Added all the permission checks to the sceneexternalchecks and modified permission module to follow this.

*This makes permission checking much more modular; allows restrictive and granting module to be made without modifying the existing permission module
This commit is contained in:
mingchen
2008-05-08 19:37:57 +00:00
parent 4b924f2eb6
commit 6c71a04da8
11 changed files with 666 additions and 215 deletions

View File

@@ -73,7 +73,7 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendInventoryItemCreateUpdate(item);
int userlevel = 0;
if (Permissions.IsEstateManager(remoteClient.AgentId))
if (ExternalChecks.ExternalChecksCanBeGodLike(remoteClient.AgentId))
{
userlevel = 1;
}
@@ -988,13 +988,11 @@ namespace OpenSim.Region.Environment.Scenes
bool permission;
if (DeRezPacket.AgentBlock.Destination == 1)
{ // Take Copy
permission = Permissions.CanCopyObject(remoteClient.AgentId,
((SceneObjectGroup) selectedEnt).UUID);
permission = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
}
else
{ // Take
permission = Permissions.CanDeRezObject(remoteClient.AgentId,
((SceneObjectGroup) selectedEnt).UUID);
permission = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
}
if (permission)
@@ -1285,7 +1283,7 @@ namespace OpenSim.Region.Environment.Scenes
{
string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
if (!Permissions.CanRezObject(remoteClient.AgentId, pos, group.Children.Count) && !attachment)
if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count,remoteClient.AgentId, pos) && !attachment)
{
return null;
}
@@ -1371,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes
string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
if (!Permissions.CanRezObject(ownerID, pos, group.Children.Count))
if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos))
{
return null;
}