Restructure god level and permissions

Create a class GodController which controls all aspects of god level,
viewer modes and user levels at ScenePresence level.
This commit is contained in:
Melanie Thielker
2017-01-06 00:55:14 +00:00
parent 46bffad558
commit ad8915f154
22 changed files with 105 additions and 150 deletions

View File

@@ -1977,7 +1977,7 @@ namespace OpenSim.Region.CoreModules.World.Land
ScenePresence SP;
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
if (SP.UserLevel != 0)
if (SP.GodController.UserLevel != 0)
{
if (flags == 0) //All parcels, scripted or not
{
@@ -2043,7 +2043,7 @@ namespace OpenSim.Region.CoreModules.World.Land
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
System.Threading.Timer Timer;
if (targetAvatar.UserLevel == 0)
if (targetAvatar.GodController.UserLevel == 0)
{
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true))

View File

@@ -547,7 +547,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
{
ScenePresence sp = m_scene.GetScenePresence(user);
if (sp != null)
return (sp.UserLevel >= 200);
return (sp.GodController.UserLevel >= 200);
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user);
if (account != null)