diff options
author | Jeff Ames | 2008-05-16 01:22:11 +0000 |
---|---|---|
committer | Jeff Ames | 2008-05-16 01:22:11 +0000 |
commit | 65c5efe43b68700bad94076d4cd421160203c5de (patch) | |
tree | 589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |
parent | Thank you very much, mjm for : (diff) | |
download | opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.zip opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2 opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index d31a250..43e8f36 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
47 | 47 | ||
48 | #region Constants | 48 | #region Constants |
49 | // These are here for testing. They will be taken out | 49 | // These are here for testing. They will be taken out |
50 | 50 | ||
51 | //private uint PERM_ALL = (uint)2147483647; | 51 | //private uint PERM_ALL = (uint)2147483647; |
52 | private uint PERM_COPY = (uint)32768; | 52 | private uint PERM_COPY = (uint)32768; |
53 | //private uint PERM_MODIFY = (uint)16384; | 53 | //private uint PERM_MODIFY = (uint)16384; |
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
59 | 59 | ||
60 | #region Bypass Permissions / Debug Permissions Stuff | 60 | #region Bypass Permissions / Debug Permissions Stuff |
61 | 61 | ||
62 | // Bypasses the permissions engine | 62 | // Bypasses the permissions engine |
63 | private bool m_bypassPermissions = false; | 63 | private bool m_bypassPermissions = false; |
64 | private bool m_bypassPermissionsValue = true; | 64 | private bool m_bypassPermissionsValue = true; |
65 | private bool m_debugPermissions = false; | 65 | private bool m_debugPermissions = false; |
@@ -126,18 +126,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
126 | public void Initialise(Scene scene, IConfigSource config) | 126 | public void Initialise(Scene scene, IConfigSource config) |
127 | { | 127 | { |
128 | m_scene = scene; | 128 | m_scene = scene; |
129 | 129 | ||
130 | IConfig myConfig = config.Configs["Startup"]; | 130 | IConfig myConfig = config.Configs["Startup"]; |
131 | |||
132 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
133 | 131 | ||
134 | List<string> modules=new List<string>(permissionModules.Split(',')); | 132 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); |
133 | |||
134 | List<string> modules=new List<string>(permissionModules.Split(',')); | ||
135 | 135 | ||
136 | if(!modules.Contains("DefaultPermissionsModule")) | 136 | if (!modules.Contains("DefaultPermissionsModule")) |
137 | return; | 137 | return; |
138 | |||
139 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | ||
138 | 140 | ||
139 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); | ||
140 | |||
141 | m_scene.RegisterModuleInterface<IScenePermissions>(this); | 141 | m_scene.RegisterModuleInterface<IScenePermissions>(this); |
142 | 142 | ||
143 | //Register functions with Scene External Checks! | 143 | //Register functions with Scene External Checks! |
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
212 | get { return false; } | 212 | get { return false; } |
213 | } | 213 | } |
214 | 214 | ||
215 | #endregion | 215 | #endregion |
216 | 216 | ||
217 | #region Helper Functions | 217 | #region Helper Functions |
218 | protected void SendPermissionError(LLUUID user, string reason) | 218 | protected void SendPermissionError(LLUUID user, string reason) |
@@ -252,38 +252,38 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
252 | } | 252 | } |
253 | #endregion | 253 | #endregion |
254 | 254 | ||
255 | public bool PropagatePermissions() | 255 | public bool PropagatePermissions() |
256 | { | 256 | { |
257 | return false; | 257 | return false; |
258 | } | 258 | } |
259 | 259 | ||
260 | public bool BypassPermissions() | 260 | public bool BypassPermissions() |
261 | { | 261 | { |
262 | return m_bypassPermissions; | 262 | return m_bypassPermissions; |
263 | } | 263 | } |
264 | 264 | ||
265 | public void SetBypassPermissions(bool value) | 265 | public void SetBypassPermissions(bool value) |
266 | { | 266 | { |
267 | m_bypassPermissions=value; | 267 | m_bypassPermissions=value; |
268 | } | 268 | } |
269 | 269 | ||
270 | #region Object Permissions | 270 | #region Object Permissions |
271 | 271 | ||
272 | public uint GenerateClientFlags(LLUUID user, LLUUID objID) | 272 | public uint GenerateClientFlags(LLUUID user, LLUUID objID) |
273 | { | 273 | { |
274 | // Here's the way this works, | 274 | // Here's the way this works, |
275 | // ObjectFlags and Permission flags are two different enumerations | 275 | // ObjectFlags and Permission flags are two different enumerations |
276 | // ObjectFlags, however, tells the client to change what it will allow the user to do. | 276 | // ObjectFlags, however, tells the client to change what it will allow the user to do. |
277 | // So, that means that all of the permissions type ObjectFlags are /temporary/ and only | 277 | // So, that means that all of the permissions type ObjectFlags are /temporary/ and only |
278 | // supposed to be set when customizing the objectflags for the client. | 278 | // supposed to be set when customizing the objectflags for the client. |
279 | 279 | ||
280 | // These temporary objectflags get computed and added in this function based on the | 280 | // These temporary objectflags get computed and added in this function based on the |
281 | // Permission mask that's appropriate! | 281 | // Permission mask that's appropriate! |
282 | // Outside of this method, they should never be added to objectflags! | 282 | // Outside of this method, they should never be added to objectflags! |
283 | // -teravus | 283 | // -teravus |
284 | 284 | ||
285 | SceneObjectPart task=m_scene.GetSceneObjectPart(objID); | 285 | SceneObjectPart task=m_scene.GetSceneObjectPart(objID); |
286 | 286 | ||
287 | // this shouldn't ever happen.. return no permissions/objectflags. | 287 | // this shouldn't ever happen.. return no permissions/objectflags. |
288 | if (task == null) | 288 | if (task == null) |
289 | return (uint)0; | 289 | return (uint)0; |
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
292 | LLUUID objectOwner = task.OwnerID; | 292 | LLUUID objectOwner = task.OwnerID; |
293 | 293 | ||
294 | 294 | ||
295 | // Remove any of the objectFlags that are temporary. These will get added back if appropriate | 295 | // Remove any of the objectFlags that are temporary. These will get added back if appropriate |
296 | // in the next bit of code | 296 | // in the next bit of code |
297 | 297 | ||
298 | objflags &= (uint) | 298 | objflags &= (uint) |
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
354 | 354 | ||
355 | private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask) | 355 | private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask) |
356 | { | 356 | { |
357 | // We are adding the temporary objectflags to the object's objectflags based on the | 357 | // We are adding the temporary objectflags to the object's objectflags based on the |
358 | // permission flag given. These change the F flags on the client. | 358 | // permission flag given. These change the F flags on the client. |
359 | 359 | ||
360 | if ((setPermissionMask & (uint)PermissionMask.Copy) != 0) | 360 | if ((setPermissionMask & (uint)PermissionMask.Copy) != 0) |
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
404 | locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); | 404 | locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); |
405 | 405 | ||
406 | // People shouldn't be able to do anything with locked objects, except the Administrator | 406 | // People shouldn't be able to do anything with locked objects, except the Administrator |
407 | // The 'set permissions' runs through a different permission check, so when an object owner | 407 | // The 'set permissions' runs through a different permission check, so when an object owner |
408 | // sets an object locked, the only thing that they can do is unlock it. | 408 | // sets an object locked, the only thing that they can do is unlock it. |
409 | // | 409 | // |
410 | // Nobody but the object owner can set permissions on an object | 410 | // Nobody but the object owner can set permissions on an object |
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
458 | bool permission = false; | 458 | bool permission = false; |
459 | string reason = "Only registered users may communicate with another account."; | 459 | string reason = "Only registered users may communicate with another account."; |
460 | 460 | ||
461 | 461 | ||
462 | if (IsAdministrator(user)) | 462 | if (IsAdministrator(user)) |
463 | permission = true; | 463 | permission = true; |
464 | 464 | ||
@@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
521 | return GenericParcelPermission(user, parcel); | 521 | return GenericParcelPermission(user, parcel); |
522 | } | 522 | } |
523 | #endregion | 523 | #endregion |
524 | 524 | ||
525 | #region Permission Checks | 525 | #region Permission Checks |
526 | private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene) | 526 | private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene) |
527 | { | 527 | { |
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
607 | { | 607 | { |
608 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 608 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
609 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 609 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
610 | 610 | ||
611 | return GenericCommunicationPermission(user, target); | 611 | return GenericCommunicationPermission(user, target); |
612 | } | 612 | } |
613 | 613 | ||
@@ -632,8 +632,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
632 | return false; | 632 | return false; |
633 | } | 633 | } |
634 | 634 | ||
635 | // The client | 635 | // The client |
636 | // may request to edit linked parts, and therefore, it needs | 636 | // may request to edit linked parts, and therefore, it needs |
637 | // to also check for SceneObjectPart | 637 | // to also check for SceneObjectPart |
638 | 638 | ||
639 | // If it's not an object, we cant edit it. | 639 | // If it's not an object, we cant edit it. |
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
647 | 647 | ||
648 | 648 | ||
649 | LLUUID taskOwner = null; | 649 | LLUUID taskOwner = null; |
650 | // Added this because at this point in time it wouldn't be wise for | 650 | // Added this because at this point in time it wouldn't be wise for |
651 | // the administrator object permissions to take effect. | 651 | // the administrator object permissions to take effect. |
652 | LLUUID objectOwner = task.OwnerID; | 652 | LLUUID objectOwner = task.OwnerID; |
653 | 653 | ||
@@ -682,12 +682,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
682 | 682 | ||
683 | 683 | ||
684 | // This is an exception to the generic object permission. | 684 | // This is an exception to the generic object permission. |
685 | // Administrators who lock their objects should not be able to move them, | 685 | // Administrators who lock their objects should not be able to move them, |
686 | // however generic object permission should return true. | 686 | // however generic object permission should return true. |
687 | // This keeps locked objects from being affected by random click + drag actions by accident | 687 | // This keeps locked objects from being affected by random click + drag actions by accident |
688 | // and allows the administrator to grab or delete a locked object. | 688 | // and allows the administrator to grab or delete a locked object. |
689 | 689 | ||
690 | // Administrators and estate managers are still able to click+grab locked objects not | 690 | // Administrators and estate managers are still able to click+grab locked objects not |
691 | // owned by them in the scene | 691 | // owned by them in the scene |
692 | // This is by design. | 692 | // This is by design. |
693 | 693 | ||
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
834 | 834 | ||
835 | SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; | 835 | SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; |
836 | LLUUID taskOwner = null; | 836 | LLUUID taskOwner = null; |
837 | // Added this because at this point in time it wouldn't be wise for | 837 | // Added this because at this point in time it wouldn't be wise for |
838 | // the administrator object permissions to take effect. | 838 | // the administrator object permissions to take effect. |
839 | LLUUID objectOwner = task.OwnerID; | 839 | LLUUID objectOwner = task.OwnerID; |
840 | 840 | ||
@@ -895,61 +895,61 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
895 | 895 | ||
896 | #endregion | 896 | #endregion |
897 | 897 | ||
898 | public bool CanLinkObject(LLUUID userID, LLUUID objectID) | 898 | public bool CanLinkObject(LLUUID userID, LLUUID objectID) |
899 | { | 899 | { |
900 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 900 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
901 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 901 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
902 | 902 | ||
903 | return true; | 903 | return true; |
904 | } | 904 | } |
905 | 905 | ||
906 | public bool CanDelinkObject(LLUUID userID, LLUUID objectID) | 906 | public bool CanDelinkObject(LLUUID userID, LLUUID objectID) |
907 | { | 907 | { |
908 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 908 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
909 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 909 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
910 | 910 | ||
911 | return true; | 911 | return true; |
912 | } | 912 | } |
913 | 913 | ||
914 | public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene) | 914 | public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene) |
915 | { | 915 | { |
916 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 916 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
917 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 917 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
918 | 918 | ||
919 | return true; | 919 | return true; |
920 | } | 920 | } |
921 | 921 | ||
922 | public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 922 | public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) |
923 | { | 923 | { |
924 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 924 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
925 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 925 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
926 | 926 | ||
927 | return true; | 927 | return true; |
928 | } | 928 | } |
929 | 929 | ||
930 | public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) | 930 | public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) |
931 | { | 931 | { |
932 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 932 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
933 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 933 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
934 | 934 | ||
935 | return true; | 935 | return true; |
936 | } | 936 | } |
937 | 937 | ||
938 | public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) | 938 | public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) |
939 | { | 939 | { |
940 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 940 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
941 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 941 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
942 | 942 | ||
943 | return true; | 943 | return true; |
944 | } | 944 | } |
945 | 945 | ||
946 | public bool CanTeleport(LLUUID userID) | 946 | public bool CanTeleport(LLUUID userID) |
947 | { | 947 | { |
948 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 948 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
949 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 949 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
950 | 950 | ||
951 | return true; | 951 | return true; |
952 | } | 952 | } |
953 | 953 | ||
954 | 954 | ||
955 | } | 955 | } |