Orbit Docs
Get Started
Deployment
Architecture
Architecture Overview
Shared Packages
Database
Database Schema
Triggers & Functions
Features
Spaces
Posts
Comments
Follows
Notifications
Feeds
Roles
Roles & Permissions
Api
Admin Api
Users
Roles
Site Configuration
Content Moderation — Posts
Content Moderation — Spaces
Hub Api
Spaces
Posts
Comments
Reactions
Memberships
Follows
Feeds
Uploads
Views
Other Api
Profile
Public Profiles
Notifications
Leaderboard
About
OG Metadata
User Search
Sponsored
Aveiro
aveiro.app
TrademarkTrademark
Ctrl k
Search...
Sign up
Orbit Docs
Get Started
Deployment
Architecture
Architecture Overview
Shared Packages
Database
Database Schema
Triggers & Functions
Features
Spaces
Posts
Comments
Follows
Notifications
Feeds
Roles
Roles & Permissions
Api
Admin Api
Users
Roles
Site Configuration
Content Moderation — Posts
Content Moderation — Spaces
Hub Api
Spaces
Posts
Comments
Reactions
Memberships
Follows
Feeds
Uploads
Views
Other Api
Profile
Public Profiles
Notifications
Leaderboard
About
OG Metadata
User Search

Roles & Permissions

Global roles, space-level roles, and the rank-based permission system.
Updated 11d ago
Sponsored
Aveiro
aveiro.app
Sponsored
Aveiro
aveiro.app
Sponsored
Aveiro
aveiro.app
TrademarkTrademark
OrbitSupa Social by Dopler
© Dopler. All rights reserved.
Built with Aveiro
Supa Hub uses a dual-layer role system: global roles that apply site-wide, and space-level roles that apply within individual spaces.

Global Roles

Every user is assigned exactly one global role via the user_global_roles table. New users automatically receive the member role on signup.
Role
Rank
Capabilities
admin100Full site control: manage users, assign roles, configure site settings, moderate all content
moderator80Content moderation: pin/hide/suspend/delete posts, manage spaces, edit site rules
member50Standard user: create posts, comment, react, join spaces, follow users
suspended20Limited: can sign in but most actions are restricted
banned0No access

How Rank Checks Work

Permissions are checked using numeric rank comparisons (roleRank >= threshold), not role name strings. This means:
  • roleRank >= 100 → admin only
  • roleRank >= 80 → moderator and admin
  • roleRank >= 50 → member, moderator, and admin
  • roleRank >= 20 → suspended and above
This design makes it easy to add new roles between existing ones without changing permission logic.

Configurable Permissions

Some permission thresholds are stored in the hub_site_config table and can be changed by admins via the admin panel:
Config Key
Default
Description
space_creation_min_rank80Who can create new spaces
Admins can change this to 50 (all members) or 100 (admin only) from the Site Config page at /admin/config.

Space-Level Roles

Within each space, members have a separate role defined in hub_space_members:
Role
Capabilities
adminFull control of the space: edit settings, manage members, moderate posts
moderatorModerate posts within the space: pin, hide, delete
memberPost content and comment within the space
guestView-only access
suspendedRestricted within this space
bannedNo access to this space

Space Role vs Global Role

Space roles and global roles are independent. A user with global member role can be a space admin. A global moderator has moderation powers across all spaces regardless of their space-level role. Permission resolution for post moderation: Permission resolution for post deletion:

Permission Matrix

Action
Member (50)
Moderator (80)
Admin (100)
Space Mod
Post Owner
Create post✓✓✓——
Edit own post————✓
Delete post—✓✓✓✓
Pin/unpin post—✓✓✓—
Hide/unhide post—✓✓✓—
Suspend post——✓——
Create spaceconfigurableconfigurable✓——
Edit space—✓✓✓—
Delete/hide space—✓✓——
Manage space members———✓—
Edit site rules—✓✓——
Manage users/roles——✓——
Site configuration——✓——
Comment✓✓✓——
Edit own comment————✓
Delete comment—✓✓✓✓
React to posts✓✓✓——
Follow users✓✓✓——

First Admin Setup

After deploying for the first time:
  • Sign up as the first user
  • Open the Supabase dashboard
  • In the user_global_roles table, change your role_id from member to admin
  • You can now access the admin panel at /admin on the auth app and manage all other users' roles from the UI
Can moderate post? = isGlobalMod (roleRank >= 80) OR isSpaceMod (space role is admin/moderator)
Can delete post? = isGlobalMod (roleRank >= 80) OR isSpaceMod (space role is admin/moderator) OR isOwner (post author)