Permissions
Local Universe uses a bitfield-based permission system for controlling access within systems and channels. Permissions are stored as serialized bigints (strings in JSON).
Permission Bitfields
Each permission is a single bit in a bigint. To check if a permission is set, use a bitwise AND: (permissions & permission) === permission.
General Permissions
| Permission | Bit | Value | Description |
|---|---|---|---|
| CREATE_INSTANT_INVITE | 0 | 1 << 0 | Create invites to the system |
| KICK_MEMBERS | 1 | 1 << 1 | Kick members from the system |
| BAN_MEMBERS | 2 | 1 << 2 | Ban members from the system |
| ADMINISTRATOR | 3 | 1 << 3 | Full access, bypasses all permission checks |
| MANAGE_CHANNELS | 4 | 1 << 4 | Create, edit, and delete channels |
| MANAGE_SYSTEM | 5 | 1 << 5 | Edit system name, icon, banner, and settings |
| ADD_REACTIONS | 6 | 1 << 6 | Add reactions to messages |
| VIEW_AUDIT_LOG | 7 | 1 << 7 | View the system audit log |
| PRIORITY_SPEAKER | 8 | 1 << 8 | Priority speaker in voice channels |
| STREAM | 9 | 1 << 9 | Stream in voice channels |
| VIEW_CHANNEL | 10 | 1 << 10 | View text and voice channels |
| SEND_MESSAGES | 11 | 1 << 11 | Send messages in text channels |
| SEND_TTS_MESSAGES | 12 | 1 << 12 | Send text-to-speech messages |
| MANAGE_MESSAGES | 13 | 1 << 13 | Delete messages and pin messages |
| EMBED_LINKS | 14 | 1 << 14 | Embed links in messages |
| ATTACH_FILES | 15 | 1 << 15 | Upload files in messages |
| READ_MESSAGE_HISTORY | 16 | 1 << 16 | Read message history |
| MENTION_EVERYONE | 17 | 1 << 17 | Use @everyone and @here mentions |
| USE_EXTERNAL_EMOJIS | 18 | 1 << 18 | Use emojis from other systems |
| VIEW_SYSTEM_INSIGHTS | 19 | 1 << 19 | View system analytics and insights |
Voice Permissions
| Permission | Bit | Value | Description |
|---|---|---|---|
| CONNECT | 20 | 1 << 20 | Connect to voice channels |
| SPEAK | 21 | 1 << 21 | Speak in voice channels |
| MUTE_MEMBERS | 22 | 1 << 22 | Mute other members in voice |
| DEAFEN_MEMBERS | 23 | 1 << 23 | Deafen other members in voice |
| MOVE_MEMBERS | 24 | 1 << 24 | Move members between voice channels |
| USE_VAD | 25 | 1 << 25 | Use voice activity detection |
Management Permissions
| Permission | Bit | Value | Description |
|---|---|---|---|
| CHANGE_NICKNAME | 26 | 1 << 26 | Change own nickname |
| MANAGE_NICKNAMES | 27 | 1 << 27 | Change other members' nicknames |
| MANAGE_ROLES | 28 | 1 << 28 | Create, edit, and delete roles |
| MANAGE_WEBHOOKS | 29 | 1 << 29 | Create, edit, and delete webhooks |
| MANAGE_EMOJIS_AND_STICKERS | 30 | 1 << 30 | Manage custom emojis and stickers |
| USE_APPLICATION_COMMANDS | 31 | 1 << 31 | Use bot and application commands |
| REQUEST_TO_SPEAK | 32 | 1 << 32 | Request to speak in stage channels |
| MANAGE_EVENTS | 33 | 1 << 33 | Create, edit, and delete events |
| MANAGE_THREADS | 34 | 1 << 34 | Manage threads |
| CREATE_PUBLIC_THREADS | 35 | 1 << 35 | Create public threads |
| CREATE_PRIVATE_THREADS | 36 | 1 << 36 | Create private threads |
| USE_EXTERNAL_STICKERS | 37 | 1 << 37 | Use stickers from other systems |
| SEND_MESSAGES_IN_THREADS | 38 | 1 << 38 | Send messages in threads |
| USE_EMBEDDED_ACTIVITIES | 39 | 1 << 39 | Use embedded activities |
| MODERATE_MEMBERS | 40 | 1 << 40 | Timeout and moderate members |
LocalUniverse-Specific Permissions
| Permission | Bit | Value | Description |
|---|---|---|---|
| BUILD | 41 | 1 << 41 | Place and modify tiles on planets |
| PLACE_PREFABS | 42 | 1 << 42 | Place prefab objects on planets |
| DESTROY | 43 | 1 << 43 | Destroy tiles and prefabs on planets |
| USE_VOICE_CHAT | 44 | 1 << 44 | Use voice chat in the system |
Overwrite Types
Channel-level permission overwrites can target either a role or a specific member.
| Type | Value | Description |
|---|---|---|
| ROLE | 0 | Overwrite applies to a role |
| MEMBER | 1 | Overwrite applies to a specific member |
Permission Computation
Permissions are computed in the following order:
- Base permissions — combine the permissions of all roles the member has (bitwise OR)
- Administrator check — if the ADMINISTRATOR bit is set, grant all permissions
- @everyone overwrites — apply the channel's @everyone role overwrites (deny, then allow)
- Role overwrites — collect all matching role overwrites and apply (deny, then allow)
- Member overwrites — apply the member-specific overwrite if one exists (deny, then allow)
Member overwrites have the highest priority and can override any role-level permission.
Default Permissions
The default @everyone role in a new system is granted these permissions:
- CREATE_INSTANT_INVITE
- VIEW_CHANNEL
- SEND_MESSAGES
- READ_MESSAGE_HISTORY
- ADD_REACTIONS
- USE_EXTERNAL_EMOJIS
- CONNECT
- SPEAK
- USE_VAD
- CHANGE_NICKNAME
- USE_VOICE_CHAT
