aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs214
1 files changed, 107 insertions, 107 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 06900f0..1a61771 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
47 public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule 47 public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule
48 { 48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 protected Scene m_scene; 51 protected Scene m_scene;
52 protected bool m_Enabled; 52 protected bool m_Enabled;
53 53
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
77 private uint PERM_MOVE = (uint)524288; 77 private uint PERM_MOVE = (uint)524288;
78 private uint PERM_TRANS = (uint)8192; 78 private uint PERM_TRANS = (uint)8192;
79 private uint PERM_LOCKED = (uint)540672; 79 private uint PERM_LOCKED = (uint)540672;
80 80
81 /// <value> 81 /// <value>
82 /// Different user set names that come in from the configuration file. 82 /// Different user set names that come in from the configuration file.
83 /// </value> 83 /// </value>
@@ -110,17 +110,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
110 private UserSet m_allowedScriptCreators = UserSet.All; 110 private UserSet m_allowedScriptCreators = UserSet.All;
111 111
112 /// <value> 112 /// <value>
113 /// The set of users that are allowed to edit (save) scripts. This is only active if 113 /// The set of users that are allowed to edit (save) scripts. This is only active if
114 /// permissions are not being bypassed. This overrides normal permissions.- 114 /// permissions are not being bypassed. This overrides normal permissions.-
115 /// </value> 115 /// </value>
116 private UserSet m_allowedScriptEditors = UserSet.All; 116 private UserSet m_allowedScriptEditors = UserSet.All;
117 117
118 private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); 118 private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>();
119 private Dictionary<string, bool> GrantCS = new Dictionary<string, bool>(); 119 private Dictionary<string, bool> GrantCS = new Dictionary<string, bool>();
120 private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); 120 private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>();
121 private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); 121 private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>();
122 private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); 122 private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>();
123 123
124 private IFriendsModule m_friendsModule; 124 private IFriendsModule m_friendsModule;
125 private IFriendsModule FriendsModule 125 private IFriendsModule FriendsModule
126 { 126 {
@@ -169,20 +169,20 @@ namespace OpenSim.Region.CoreModules.World.Permissions
169 m_Enabled = true; 169 m_Enabled = true;
170 170
171 m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods", 171 m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods",
172 new string[] { "Startup", "Permissions" }, false); 172 new string[] { "Startup", "Permissions" }, false);
173 m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions", 173 m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions",
174 new string[] { "Startup", "Permissions" }, true); 174 new string[] { "Startup", "Permissions" }, true);
175 m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions", 175 m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions",
176 new string[] { "Startup", "Permissions" }, true); 176 new string[] { "Startup", "Permissions" }, true);
177 m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god", 177 m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god",
178 new string[] { "Startup", "Permissions" }, true); 178 new string[] { "Startup", "Permissions" }, true);
179 m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god", 179 m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god",
180 new string[] { "Startup", "Permissions" }, false); 180 new string[] { "Startup", "Permissions" }, false);
181 m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god", 181 m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god",
182 new string[] { "Startup", "Permissions" }, false); 182 new string[] { "Startup", "Permissions" }, false);
183 183
184 m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions", 184 m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions",
185 new string[] { "Startup", "Permissions" }, false); 185 new string[] { "Startup", "Permissions" }, false);
186 186
187 m_allowedScriptCreators 187 m_allowedScriptCreators
188 = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); 188 = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators);
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
206 } 206 }
207 207
208 grant = Util.GetConfigVarFromSections<string>(config, "GrantCS", 208 grant = Util.GetConfigVarFromSections<string>(config, "GrantCS",
209 new string[] { "Startup", "Permissions" }, string.Empty); 209 new string[] { "Startup", "Permissions" }, string.Empty);
210 if (grant.Length > 0) 210 if (grant.Length > 0)
211 { 211 {
212 foreach (string uuidl in grant.Split(',')) 212 foreach (string uuidl in grant.Split(','))
@@ -273,46 +273,46 @@ namespace OpenSim.Region.CoreModules.World.Permissions
273 m_scene.Permissions.OnIsAdministrator += IsAdministrator; 273 m_scene.Permissions.OnIsAdministrator += IsAdministrator;
274 m_scene.Permissions.OnIsEstateManager += IsEstateManager; 274 m_scene.Permissions.OnIsEstateManager += IsEstateManager;
275 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; 275 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
276 m_scene.Permissions.OnDeleteObject += CanDeleteObject; 276 m_scene.Permissions.OnDeleteObject += CanDeleteObject;
277 m_scene.Permissions.OnEditObject += CanEditObject; 277 m_scene.Permissions.OnEditObject += CanEditObject;
278 m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; 278 m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties;
279 m_scene.Permissions.OnInstantMessage += CanInstantMessage; 279 m_scene.Permissions.OnInstantMessage += CanInstantMessage;
280 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; 280 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer;
281 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; 281 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand;
282 m_scene.Permissions.OnMoveObject += CanMoveObject; 282 m_scene.Permissions.OnMoveObject += CanMoveObject;
283 m_scene.Permissions.OnObjectEntry += CanObjectEntry; 283 m_scene.Permissions.OnObjectEntry += CanObjectEntry;
284 m_scene.Permissions.OnReturnObjects += CanReturnObjects; 284 m_scene.Permissions.OnReturnObjects += CanReturnObjects;
285 m_scene.Permissions.OnRezObject += CanRezObject; 285 m_scene.Permissions.OnRezObject += CanRezObject;
286 m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; 286 m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand;
287 m_scene.Permissions.OnRunScript += CanRunScript; 287 m_scene.Permissions.OnRunScript += CanRunScript;
288 m_scene.Permissions.OnCompileScript += CanCompileScript; 288 m_scene.Permissions.OnCompileScript += CanCompileScript;
289 m_scene.Permissions.OnSellParcel += CanSellParcel; 289 m_scene.Permissions.OnSellParcel += CanSellParcel;
290 m_scene.Permissions.OnTakeObject += CanTakeObject; 290 m_scene.Permissions.OnTakeObject += CanTakeObject;
291 m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; 291 m_scene.Permissions.OnSellGroupObject += CanSellGroupObject;
292 m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; 292 m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject;
293 m_scene.Permissions.OnTerraformLand += CanTerraformLand; 293 m_scene.Permissions.OnTerraformLand += CanTerraformLand;
294 m_scene.Permissions.OnLinkObject += CanLinkObject; 294 m_scene.Permissions.OnLinkObject += CanLinkObject;
295 m_scene.Permissions.OnDelinkObject += CanDelinkObject; 295 m_scene.Permissions.OnDelinkObject += CanDelinkObject;
296 m_scene.Permissions.OnBuyLand += CanBuyLand; 296 m_scene.Permissions.OnBuyLand += CanBuyLand;
297 297
298 m_scene.Permissions.OnViewNotecard += CanViewNotecard; 298 m_scene.Permissions.OnViewNotecard += CanViewNotecard;
299 m_scene.Permissions.OnViewScript += CanViewScript; 299 m_scene.Permissions.OnViewScript += CanViewScript;
300 m_scene.Permissions.OnEditNotecard += CanEditNotecard; 300 m_scene.Permissions.OnEditNotecard += CanEditNotecard;
301 m_scene.Permissions.OnEditScript += CanEditScript; 301 m_scene.Permissions.OnEditScript += CanEditScript;
302 302
303 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; 303 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory;
304 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; 304 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;
305 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; 305 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory;
306 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; 306 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory;
307 m_scene.Permissions.OnResetScript += CanResetScript; 307 m_scene.Permissions.OnResetScript += CanResetScript;
308 308
309 m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; 309 m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory;
310 m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; 310 m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory;
311 m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; 311 m_scene.Permissions.OnEditUserInventory += CanEditUserInventory;
312 m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; 312 m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory;
313 313
314 m_scene.Permissions.OnTeleport += CanTeleport; 314 m_scene.Permissions.OnTeleport += CanTeleport;
315 315
316 m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; 316 m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia;
317 m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; 317 m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia;
318 318
@@ -329,8 +329,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
329 m_scene.AddCommand("Debug", this, "debug permissions", 329 m_scene.AddCommand("Debug", this, "debug permissions",
330 "debug permissions <true / false>", 330 "debug permissions <true / false>",
331 "Turn on permissions debugging", 331 "Turn on permissions debugging",
332 HandleDebugPermissions); 332 HandleDebugPermissions);
333 333
334 } 334 }
335 335
336 public void RegionLoaded(Scene scene) 336 public void RegionLoaded(Scene scene)
@@ -441,7 +441,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
441 { 441 {
442 m_scene.EventManager.TriggerPermissionError(user, reason); 442 m_scene.EventManager.TriggerPermissionError(user, reason);
443 } 443 }
444 444
445 protected void DebugPermissionInformation(string permissionCalled) 445 protected void DebugPermissionInformation(string permissionCalled)
446 { 446 {
447 if (m_debugPermissions) 447 if (m_debugPermissions)
@@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
471 471
472 return false; 472 return false;
473 } 473 }
474 474
475 /// <summary> 475 /// <summary>
476 /// Parse a user set configuration setting 476 /// Parse a user set configuration setting
477 /// </summary> 477 /// </summary>
@@ -483,28 +483,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions
483 { 483 {
484 UserSet userSet = defaultValue; 484 UserSet userSet = defaultValue;
485 485
486 string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName, 486 string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName,
487 new string[] {"Startup", "Permissions"}, defaultValue.ToString()); 487 new string[] {"Startup", "Permissions"}, defaultValue.ToString());
488 488
489 // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term 489 // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term
490 // this should disappear. 490 // this should disappear.
491 if ("gods" == rawSetting.ToLower()) 491 if ("gods" == rawSetting.ToLower())
492 rawSetting = UserSet.Administrators.ToString(); 492 rawSetting = UserSet.Administrators.ToString();
493 493
494 // Doing it this was so that we can do a case insensitive conversion 494 // Doing it this was so that we can do a case insensitive conversion
495 try 495 try
496 { 496 {
497 userSet = (UserSet)Enum.Parse(typeof(UserSet), rawSetting, true); 497 userSet = (UserSet)Enum.Parse(typeof(UserSet), rawSetting, true);
498 } 498 }
499 catch 499 catch
500 { 500 {
501 m_log.ErrorFormat( 501 m_log.ErrorFormat(
502 "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", 502 "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}",
503 rawSetting, settingName, userSet); 503 rawSetting, settingName, userSet);
504 } 504 }
505 505
506 m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); 506 m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet);
507 507
508 return userSet; 508 return userSet;
509 } 509 }
510 510
@@ -520,7 +520,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
520 520
521 if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) 521 if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod)
522 return true; 522 return true;
523 523
524 if (IsEstateManager(user) && m_RegionManagerIsGod) 524 if (IsEstateManager(user) && m_RegionManagerIsGod)
525 return true; 525 return true;
526 526
@@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
558 } 558 }
559 559
560 protected bool IsFriendWithPerms(UUID user, UUID objectOwner) 560 protected bool IsFriendWithPerms(UUID user, UUID objectOwner)
561 { 561 {
562 if (user == UUID.Zero) 562 if (user == UUID.Zero)
563 return false; 563 return false;
564 564
@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
572 protected bool IsEstateManager(UUID user) 572 protected bool IsEstateManager(UUID user)
573 { 573 {
574 if (user == UUID.Zero) return false; 574 if (user == UUID.Zero) return false;
575 575
576 return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user); 576 return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user);
577 } 577 }
578 578
@@ -777,7 +777,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
777 // so just return true immediately and short circuit the more 777 // so just return true immediately and short circuit the more
778 // expensive group checks 778 // expensive group checks
779 return true; 779 return true;
780 780
781 //permission = true; 781 //permission = true;
782 } 782 }
783 else if (group.IsAttachment) 783 else if (group.IsAttachment)
@@ -786,15 +786,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
786 } 786 }
787 787
788// m_log.DebugFormat( 788// m_log.DebugFormat(
789// "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}", 789// "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}",
790// group.GroupID, 790// group.GroupID,
791// m_scene.GetSceneObjectPart(objId).GroupMask, 791// m_scene.GetSceneObjectPart(objId).GroupMask,
792// IsGroupMember(group.GroupID, currentUser, 0), 792// IsGroupMember(group.GroupID, currentUser, 0),
793// currentUser); 793// currentUser);
794 794
795 // Group members should be able to edit group objects 795 // Group members should be able to edit group objects
796 if ((group.GroupID != UUID.Zero) 796 if ((group.GroupID != UUID.Zero)
797 && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) 797 && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0)
798 && IsGroupMember(group.GroupID, currentUser, 0)) 798 && IsGroupMember(group.GroupID, currentUser, 0))
799 { 799 {
800 // Return immediately, so that the administrator can shares group objects 800 // Return immediately, so that the administrator can shares group objects
@@ -807,7 +807,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
807 // Return immediately, so that the administrator can share objects with friends 807 // Return immediately, so that the administrator can share objects with friends
808 return true; 808 return true;
809 } 809 }
810 810
811 // Users should be able to edit what is over their land. 811 // Users should be able to edit what is over their land.
812 ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); 812 ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y);
813 if ((parcel != null) && (parcel.LandData.OwnerID == currentUser)) 813 if ((parcel != null) && (parcel.LandData.OwnerID == currentUser))
@@ -904,7 +904,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
904 904
905 return permission; 905 return permission;
906 } 906 }
907 907
908 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager) 908 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager)
909 { 909 {
910 if (parcel.LandData.OwnerID == user) 910 if (parcel.LandData.OwnerID == user)
@@ -919,7 +919,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
919 { 919 {
920 return true; 920 return true;
921 } 921 }
922 922
923 if (allowEstateManager && IsEstateManager(user)) 923 if (allowEstateManager && IsEstateManager(user))
924 { 924 {
925 return true; 925 return true;
@@ -946,7 +946,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
946 { 946 {
947 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 947 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
948 if (m_bypassPermissions) return m_bypassPermissionsValue; 948 if (m_bypassPermissions) return m_bypassPermissionsValue;
949 949
950 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false); 950 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false);
951 } 951 }
952 952
@@ -1007,7 +1007,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1007 //They can't even edit the object 1007 //They can't even edit the object
1008 return false; 1008 return false;
1009 } 1009 }
1010 1010
1011 SceneObjectPart part = scene.GetSceneObjectPart(objectID); 1011 SceneObjectPart part = scene.GetSceneObjectPart(objectID);
1012 if (part == null) 1012 if (part == null)
1013 return false; 1013 return false;
@@ -1025,7 +1025,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1025 if ((part.GroupMask & PERM_COPY) == 0) 1025 if ((part.GroupMask & PERM_COPY) == 0)
1026 return false; 1026 return false;
1027 } 1027 }
1028 1028
1029 //If they can rez, they can duplicate 1029 //If they can rez, they can duplicate
1030 return CanRezObject(objectCount, owner, objectPosition, scene); 1030 return CanRezObject(objectCount, owner, objectPosition, scene);
1031 } 1031 }
@@ -1074,10 +1074,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1074 { 1074 {
1075 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1075 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1076 if (m_bypassPermissions) return m_bypassPermissionsValue; 1076 if (m_bypassPermissions) return m_bypassPermissionsValue;
1077 1077
1078 if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) 1078 if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user))
1079 return false; 1079 return false;
1080 1080
1081 // Ordinarily, if you can view it, you can edit it 1081 // Ordinarily, if you can view it, you can edit it
1082 // There is no viewing a no mod script 1082 // There is no viewing a no mod script
1083 // 1083 //
@@ -1135,10 +1135,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1135 1135
1136 if (!IsGroupMember(part.GroupID, user, 0)) 1136 if (!IsGroupMember(part.GroupID, user, 0))
1137 return false; 1137 return false;
1138 1138
1139 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) 1139 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
1140 return false; 1140 return false;
1141 } 1141 }
1142 else 1142 else
1143 { 1143 {
1144 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1144 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
@@ -1572,7 +1572,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1572 if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) 1572 if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY)
1573 permission = false; 1573 permission = false;
1574 } 1574 }
1575 1575
1576 return permission; 1576 return permission;
1577 } 1577 }
1578 1578
@@ -1662,7 +1662,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1662 1662
1663 if (part == null) 1663 if (part == null)
1664 return false; 1664 return false;
1665 1665
1666 if (part.OwnerID != user) 1666 if (part.OwnerID != user)
1667 { 1667 {
1668 if (part.GroupID == UUID.Zero) 1668 if (part.GroupID == UUID.Zero)
@@ -1670,11 +1670,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1670 1670
1671 if (!IsGroupMember(part.GroupID, user, 0)) 1671 if (!IsGroupMember(part.GroupID, user, 0))
1672 return false; 1672 return false;
1673 1673
1674 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) 1674 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
1675 return false; 1675 return false;
1676 } 1676 }
1677 else 1677 else
1678 { 1678 {
1679 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1679 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1680 return false; 1680 return false;
@@ -1684,12 +1684,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1684 1684
1685 if (ti == null) 1685 if (ti == null)
1686 return false; 1686 return false;
1687 1687
1688 if (ti.OwnerID != user) 1688 if (ti.OwnerID != user)
1689 { 1689 {
1690 if (ti.GroupID == UUID.Zero) 1690 if (ti.GroupID == UUID.Zero)
1691 return false; 1691 return false;
1692 1692
1693 if (!IsGroupMember(ti.GroupID, user, 0)) 1693 if (!IsGroupMember(ti.GroupID, user, 0))
1694 return false; 1694 return false;
1695 } 1695 }
@@ -1746,12 +1746,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1746 1746
1747 if (part == null) 1747 if (part == null)
1748 return false; 1748 return false;
1749 1749
1750 if (part.OwnerID != user) 1750 if (part.OwnerID != user)
1751 { 1751 {
1752 if (part.GroupID == UUID.Zero) 1752 if (part.GroupID == UUID.Zero)
1753 return false; 1753 return false;
1754 1754
1755 if (!IsGroupMember(part.GroupID, user, 0)) 1755 if (!IsGroupMember(part.GroupID, user, 0))
1756 return false; 1756 return false;
1757 } 1757 }
@@ -1768,7 +1768,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1768 { 1768 {
1769 if (ti.GroupID == UUID.Zero) 1769 if (ti.GroupID == UUID.Zero)
1770 return false; 1770 return false;
1771 1771
1772 if (!IsGroupMember(ti.GroupID, user, 0)) 1772 if (!IsGroupMember(ti.GroupID, user, 0))
1773 return false; 1773 return false;
1774 } 1774 }
@@ -1863,7 +1863,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1863 1863
1864 return true; 1864 return true;
1865 } 1865 }
1866 1866
1867 /// <summary> 1867 /// <summary>
1868 /// Check whether the specified user is allowed to create the given inventory type in their inventory. 1868 /// Check whether the specified user is allowed to create the given inventory type in their inventory.
1869 /// </summary> 1869 /// </summary>
@@ -1878,10 +1878,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1878 if ((int)InventoryType.LSL == invType) 1878 if ((int)InventoryType.LSL == invType)
1879 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) 1879 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID))
1880 return false; 1880 return false;
1881 1881
1882 return true; 1882 return true;
1883 } 1883 }
1884 1884
1885 /// <summary> 1885 /// <summary>
1886 /// Check whether the specified user is allowed to copy the given inventory type in their inventory. 1886 /// Check whether the specified user is allowed to copy the given inventory type in their inventory.
1887 /// </summary> 1887 /// </summary>
@@ -1895,7 +1895,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1895 1895
1896 return true; 1896 return true;
1897 } 1897 }
1898 1898
1899 /// <summary> 1899 /// <summary>
1900 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. 1900 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory.
1901 /// </summary> 1901 /// </summary>
@@ -1909,7 +1909,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1909 1909
1910 return true; 1910 return true;
1911 } 1911 }
1912 1912
1913 /// <summary> 1913 /// <summary>
1914 /// Check whether the specified user is allowed to delete the given inventory item from their own inventory. 1914 /// Check whether the specified user is allowed to delete the given inventory item from their own inventory.
1915 /// </summary> 1915 /// </summary>
@@ -1947,7 +1947,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1947 return GenericObjectPermission(agentID, prim, false); 1947 return GenericObjectPermission(agentID, prim, false);
1948 } 1948 }
1949 1949
1950 private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) 1950 private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene)
1951 { 1951 {
1952 //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); 1952 //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType);
1953 switch (scriptType) { 1953 switch (scriptType) {
@@ -1981,64 +1981,64 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1981 } 1981 }
1982 return(false); 1982 return(false);
1983 } 1983 }
1984 1984
1985 private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) 1985 private bool CanControlPrimMedia(UUID agentID, UUID primID, int face)
1986 { 1986 {
1987// m_log.DebugFormat( 1987// m_log.DebugFormat(
1988// "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}", 1988// "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}",
1989// agentID, primID, face); 1989// agentID, primID, face);
1990 1990
1991 if (null == MoapModule) 1991 if (null == MoapModule)
1992 return false; 1992 return false;
1993 1993
1994 SceneObjectPart part = m_scene.GetSceneObjectPart(primID); 1994 SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
1995 if (null == part) 1995 if (null == part)
1996 return false; 1996 return false;
1997 1997
1998 MediaEntry me = MoapModule.GetMediaEntry(part, face); 1998 MediaEntry me = MoapModule.GetMediaEntry(part, face);
1999 1999
2000 // If there is no existing media entry then it can be controlled (in this context, created). 2000 // If there is no existing media entry then it can be controlled (in this context, created).
2001 if (null == me) 2001 if (null == me)
2002 return true; 2002 return true;
2003 2003
2004// m_log.DebugFormat( 2004// m_log.DebugFormat(
2005// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", 2005// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}",
2006// agentID, primID, face, me.ControlPermissions); 2006// agentID, primID, face, me.ControlPermissions);
2007 2007
2008 return GenericObjectPermission(agentID, part.ParentGroup.UUID, true); 2008 return GenericObjectPermission(agentID, part.ParentGroup.UUID, true);
2009 } 2009 }
2010 2010
2011 private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) 2011 private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face)
2012 { 2012 {
2013// m_log.DebugFormat( 2013// m_log.DebugFormat(
2014// "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}", 2014// "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}",
2015// agentID, primID, face); 2015// agentID, primID, face);
2016 2016
2017 if (null == MoapModule) 2017 if (null == MoapModule)
2018 return false; 2018 return false;
2019 2019
2020 SceneObjectPart part = m_scene.GetSceneObjectPart(primID); 2020 SceneObjectPart part = m_scene.GetSceneObjectPart(primID);
2021 if (null == part) 2021 if (null == part)
2022 return false; 2022 return false;
2023 2023
2024 MediaEntry me = MoapModule.GetMediaEntry(part, face); 2024 MediaEntry me = MoapModule.GetMediaEntry(part, face);
2025 2025
2026 // If there is no existing media entry then it can be controlled (in this context, created). 2026 // If there is no existing media entry then it can be controlled (in this context, created).
2027 if (null == me) 2027 if (null == me)
2028 return true; 2028 return true;
2029 2029
2030// m_log.DebugFormat( 2030// m_log.DebugFormat(
2031// "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", 2031// "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}",
2032// agentID, primID, face, me.InteractPermissions); 2032// agentID, primID, face, me.InteractPermissions);
2033 2033
2034 return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); 2034 return GenericPrimMediaPermission(part, agentID, me.InteractPermissions);
2035 } 2035 }
2036 2036
2037 private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) 2037 private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms)
2038 { 2038 {
2039// if (IsAdministrator(agentID)) 2039// if (IsAdministrator(agentID))
2040// return true; 2040// return true;
2041 2041
2042 if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) 2042 if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone)
2043 return true; 2043 return true;
2044 2044
@@ -2047,13 +2047,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
2047 if (agentID == part.OwnerID) 2047 if (agentID == part.OwnerID)
2048 return true; 2048 return true;
2049 } 2049 }
2050 2050
2051 if ((perms & MediaPermission.Group) == MediaPermission.Group) 2051 if ((perms & MediaPermission.Group) == MediaPermission.Group)
2052 { 2052 {
2053 if (IsGroupMember(part.GroupID, agentID, 0)) 2053 if (IsGroupMember(part.GroupID, agentID, 0))
2054 return true; 2054 return true;
2055 } 2055 }
2056 2056
2057 return false; 2057 return false;
2058 } 2058 }
2059 } 2059 }