llpermissionsflags.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /**
  2. * @file llpermissionsflags.h
  3. *
  4. * $LicenseInfo:firstyear=2002&license=viewergpl$
  5. *
  6. * Copyright (c) 2002-2009, Linden Research, Inc.
  7. *
  8. * Second Life Viewer Source Code
  9. * The source code in this file ("Source Code") is provided by Linden Lab
  10. * to you under the terms of the GNU General Public License, version 2.0
  11. * ("GPL"), unless you have obtained a separate licensing agreement
  12. * ("Other License"), formally executed by you and Linden Lab. Terms of
  13. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  14. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  15. *
  16. * There are special exceptions to the terms and conditions of the GPL as
  17. * it is applied to this Source Code. View the full text of the exception
  18. * in the file doc/FLOSS-exception.txt in this software distribution, or
  19. * online at
  20. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  21. *
  22. * By copying, modifying or distributing this software, you acknowledge
  23. * that you have read and understood your obligations described above,
  24. * and agree to abide by those obligations.
  25. *
  26. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  27. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  28. * COMPLETENESS OR PERFORMANCE.
  29. * $/LicenseInfo$
  30. */
  31. #ifndef LL_LLPERMISSIONSFLAGS_H
  32. #define LL_LLPERMISSIONSFLAGS_H
  33. // Flags for various permissions bits. Shared between viewer and simulator.
  34. // Permission bits
  35. typedef U32 PermissionMask;
  36. typedef U32 PermissionBit;
  37. // Do you have permission to transfer ownership of the object or item. Fair use
  38. // rules dictate that if you cannot copy, you can always transfer.
  39. const PermissionBit PERM_TRANSFER = (1 << 13); // 0x00002000
  40. // Objects, scale or change textures parcels, allow building on it
  41. const PermissionBit PERM_MODIFY = (1 << 14); // 0x00004000
  42. // Objects, allow copy
  43. const PermissionBit PERM_COPY = (1 << 15); // 0x00008000
  44. // Objects, allow exporting (OpenSIM extension). Was formerly used in SL for
  45. // the now deprecated PERM_ENTER flag (to allow entry in parcel).
  46. const PermissionBit PERM_EXPORT = (1 << 16); // 0x00010000
  47. // Objects, can grab/translate/rotate
  48. const PermissionBit PERM_MOVE = (1 << 19); // 0x00080000
  49. // Do not use bit 31: printf/scanf with "%x" assume signed numbers
  50. const PermissionBit PERM_RESERVED = ((U32)1) << 31;
  51. #if 0 // Deprecated flags
  52. // Parcels, allow terraform
  53. const PermissionBit PERM_TERRAFORM = (1 << 17); // 0x00020000
  54. // NB: while this flag is no longer used, it is possible that some objects in
  55. // the universe have it set so DO NOT USE IT going forward.
  56. const PermissionBit PERM_OWNER_DEBIT = (1 << 18); // 0x00040000
  57. // Parcels, avatars take damage
  58. const PermissionBit PERM_DAMAGE = (1 << 20); // 0x00100000
  59. const PermissionMask PERM_ALL_PARCEL = PERM_MODIFY | PERM_ENTER |
  60. PERM_TERRAFORM | PERM_DAMAGE;
  61. #endif
  62. const PermissionMask PERM_NONE = 0x00000000;
  63. const PermissionMask PERM_ALL = 0x7FFFFFFF;
  64. const PermissionMask PERM_ITEM_UNRESTRICTED = PERM_MODIFY | PERM_COPY |
  65. PERM_TRANSFER;
  66. // Useful stuff for transmission.
  67. // Which permissions field are we trying to change ?
  68. const U8 PERM_BASE = 0x01;
  69. // *TODO: Add another PERM_OWNER operation type for allowOperationBy
  70. // DK 04/03/06
  71. const U8 PERM_OWNER = 0x02;
  72. const U8 PERM_GROUP = 0x04;
  73. const U8 PERM_EVERYONE = 0x08;
  74. const U8 PERM_NEXT_OWNER = 0x10;
  75. // This is just a quickie debugging key
  76. // no modify: PERM_ALL & ~PERM_MODIFY = 0x7fffbfff
  77. // no copy: PERM_ALL & ~PERM_COPY = 0x7fff7fff
  78. // no modify or copy: = 0x7fff3fff
  79. // no transfer: PERM_ALL & ~PERM_TRANSFER = 0x7fffdfff
  80. // no modify, no transfer = 0x7fff9fff
  81. // no copy, no transfer (INVALID!) = 0x7fff5fff
  82. // no modify, no copy, no transfer (INVALID!) = 0x7fff1fff
  83. #endif