PageRenderTime 22ms CodeModel.GetById 9ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llinventory/llpermissionsflags.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 93 lines | 18 code | 19 blank | 56 comment | 0 complexity | 49e36b075978e7c59e749af23b2d0a72 MD5 | raw file
 1/** 
 2 * @file llpermissionsflags.h
 3 *
 4 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
 5 * Second Life Viewer Source Code
 6 * Copyright (C) 2010, Linden Research, Inc.
 7 * 
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation;
11 * version 2.1 of the License only.
12 * 
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 * Lesser General Public License for more details.
17 * 
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 * 
22 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
23 * $/LicenseInfo$
24 */
25
26#ifndef LL_LLPERMISSIONSFLAGS_H
27#define LL_LLPERMISSIONSFLAGS_H
28
29// Flags for various permissions bits.
30// Shared between viewer and simulator.
31
32// permission bits
33typedef U32 PermissionMask;
34typedef U32 PermissionBit;
35
36
37// Do you have permission to transfer ownership of the object or
38// item. Fair use rules dictate that if you cannot copy, you can
39// always transfer.
40const PermissionBit PERM_TRANSFER           = (1 << 13); // 0x00002000
41
42// objects, scale or change textures
43// parcels, allow building on it
44const PermissionBit PERM_MODIFY				= (1 << 14); // 0x00004000
45
46// objects, allow copy
47const PermissionBit PERM_COPY				= (1 << 15); // 0x00008000
48
49// parcels, allow entry, deprecated
50//const PermissionBit PERM_ENTER			= (1 << 16); // 0x00010000
51
52// parcels, allow terraform, deprecated
53//const PermissionBit PERM_TERRAFORM		= (1 << 17); // 0x00020000
54
55// NOTA BENE: This flag is NO LONGER USED!!! However, it is possible that some 
56// objects in the universe have it set so DON"T USE IT going forward.
57//const PermissionBit PERM_OWNER_DEBIT		= (1 << 18); // 0x00040000
58
59// objects, can grab/translate/rotate
60const PermissionBit PERM_MOVE				= (1 << 19); // 0x00080000
61
62// parcels, avatars take damage, deprecated
63//const PermissionBit	PERM_DAMAGE			= (1 << 20); // 0x00100000
64
65// don't use bit 31 -- printf/scanf with "%x" assume signed numbers
66const PermissionBit PERM_RESERVED			= ((U32)1) << 31;
67
68const PermissionMask PERM_NONE				= 0x00000000;
69const PermissionMask PERM_ALL				= 0x7FFFFFFF;
70//const PermissionMask PERM_ALL_PARCEL 		= PERM_MODIFY | PERM_ENTER | PERM_TERRAFORM | PERM_DAMAGE;
71const PermissionMask PERM_ITEM_UNRESTRICTED =  PERM_MODIFY | PERM_COPY | PERM_TRANSFER;
72
73
74// Useful stuff for transmission.
75// Which permissions field are we trying to change?
76const U8 PERM_BASE		= 0x01;
77// TODO: Add another PERM_OWNER operation type for allowOperationBy  DK 04/03/06
78const U8 PERM_OWNER		= 0x02;
79const U8 PERM_GROUP		= 0x04;
80const U8 PERM_EVERYONE	= 0x08;
81const U8 PERM_NEXT_OWNER = 0x10;
82
83// This is just a quickie debugging key
84// no modify: PERM_ALL & ~PERM_MODIFY                  = 0x7fffbfff 
85// no copy:   PERM_ALL & ~PERM_COPY                    = 0x7fff7fff
86// no modify or copy:                                  = 0x7fff3fff
87// no transfer: PERM_ALL & ~PERM_TRANSFER              = 0x7fffdfff
88// no modify, no transfer                              = 0x7fff9fff
89// no copy, no transfer (INVALID!)                     = 0x7fff5fff
90// no modify, no copy, no transfer (INVALID!)          = 0x7fff1fff
91
92
93#endif