User Permissions & Row-Level Security
Configuring role-based access control (RBAC) and row-level security (RLS) policies.
Role-Based Access Control (RBAC)
Rayvotech Tools enforces strict role-based access control across all database operations and studio collaboration workflows:
| Role | Studio Prompting | Data Operations | Domain & Billing |
|---|---|---|---|
| Owner | ✓ Full Access | ✓ Read / Write / Delete | ✓ Manage Billing |
| Admin | ✓ Full Access | ✓ Read / Write / Delete | ✗ View Only |
| Editor | ✓ Prompt & Edit | ✓ Read / Write Assigned | ✗ No Access |
| Viewer | ✗ Read-Only Preview | ✓ Read Only | ✗ No Access |
Row-Level Security (RLS) Policies
Row-Level Security ensures users can only read or manipulate records they own, evaluated at the edge database engine:
-- Enforce user data isolation
ALTER TABLE customer_invoices ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users access own invoices"
ON customer_invoices
FOR ALL
USING (auth.uid() = user_id);
ALTER TABLE customer_invoices ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users access own invoices"
ON customer_invoices
FOR ALL
USING (auth.uid() = user_id);
Even if a client attempts a malicious query modification, unauthorized rows are filtered at the SQL engine level.