type:feature: Fine-grained Permissions #62
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#88
Original Author: @icub3d
Original Date: 2026-04-18T15:00:28Z
Feature: Fine-grained Permissions
Overview
Extend the role-based permission system with additional, more granular permission bits to support complex server configurations, bot management, and historical access control.
Background
The current permission system uses a 64-bit mask but only defines 14 bits. To support common server needs (like read-only announcement channels with historical access control or restricting bot command usage), we need more specific flags.
Requirements
READ_MESSAGE_HISTORY(bit 14) - Allow viewing messages sent before the user's current session or before they joined.USE_APPLICATION_COMMANDS(bit 15) - Allow using slash commands or interacting with bots.CREATE_INVITE(bit 16) - Separate the ability to create new invites from the ability to manage/delete them (MANAGE_INVITES).ALL_PERMISSIONSand@adminrole to include these new bits.Design
API / Interface Changes
server/src/permissions.rsto include the new constants.server/src/messages/handlers.rsto checkREAD_MESSAGE_HISTORYinlist_messages.server/src/invites/handlers.rs(if it exists) to checkCREATE_INVITE.Data Model Changes
@everyoneand@adminroles in the database migration (server/migrations/002_roles.sql) or via a new migration.Component Changes
server/src/permissions.rs: Define new bit constants.server/src/messages/handlers.rs: Updatelist_messagesto checkREAD_MESSAGE_HISTORY.Task List
server/src/permissions.rs.list_messagesforREAD_MESSAGE_HISTORY.CREATE_INVITEin the invite creation handler.Test List
permissions.rsto verify bitwise operations with new bits.READ_MESSAGESbut withoutREAD_MESSAGE_HISTORYcan see live messages but cannot fetch past ones.CREATE_INVITEcannot create an invite link even if they have other membership permissions.Open Questions
READ_MESSAGE_HISTORYapply to all messages in the channel or only those since the user joined? (Standard behavior is usually "all messages in the channel if they have the bit").