Access And Roles
Sophosic has two major authentication contexts:
- Operators use the console to manage a workspace.
- Customers use the public site and portal to manage their own orders, bookings, billing, tickets, profile, and notifications.
Console Access
Console access depends on two signals:
- User session
- Identifies the signed-in operator
- Selected workspace
- Identifies which tenant the operator is managing
The selected workspace is not enough by itself. Every privileged request should be checked against workspace membership.
This distinction matters for agencies and support teams that manage several businesses from the same browser session. A valid signed-in operator can still be unauthorized for the active workspace, so console actions should fail closed when membership, role, or selected workspace state is unclear.
Workspace Selection
The console uses flat admin routes. A path such as /settings/general or /bookings applies to the currently selected workspace.
Before making launch-impacting changes, confirm the selected workspace. This is especially important for agencies, support teams, and users with access to multiple businesses.
Use visible proof before editing: workspace name, slug/domain, known customer record, and one recent order, booking, or setting. If any proof point does not match the business you intend to manage, stop and switch workspace before saving changes.
Operator Roles
Roles determine who can manage workspace settings, bookings, orders, customers, content, integrations, and payments.
The role hierarchy is inherited: Owner includes Admin, Admin includes Manager, Manager includes Agent, and Agent includes Customer-level self-service concepts. Customer portal access is still enforced separately from console membership.
Owner
Intended use: Business ownership, billing, final access authority
Inherits: Admin
Admin
Intended use: Full workspace administration except ownership-only billing controls
Inherits: Manager
Manager
Intended use: Team oversight, analytics, queues, refunds, operational control
Inherits: Agent
Agent
Intended use: Ticket work, customer communication, bookings, orders, products, basic selling
Inherits: Customer
Customer
Intended use: Self-service portal access only
Inherits: None
General guidance:
- Owners manage the business and ownership-level settings.
- Admins manage settings, users, integrations, terminal setup, and broad workspace configuration.
- Managers run daily operations, analytics, queues, refunds, and catalog cleanup.
- Agents handle customer work, bookings, orders, communications, and basic sell flows.
- Customers should never receive console membership just to use the portal.
- Former team members should be removed promptly.
Permission Matrix
This summary groups active RBAC categories by the kind of work they protect. Implementation details still live in the RBAC package; use this as an operator-readable permission guide.
Customer support and communicationAgent+
Tickets: customers can read and create their own tickets; agents can update; managers can assign, escalate, or delete.
Customers and leads: agents can read, write, and create records; admins can delete customer records.
Communications, queues, and macros: agents can send messages and execute macros; managers own queue management and macro authoring.
Content and knowledgeManager+
Knowledge base: customers and agents can read; managers can create, write, publish, and delete.
Public content should still be verified on the sites app after role changes because publishing rights and customer visibility are different concerns.
Commerce and fulfillmentAgent to Manager
Products and shops: agents can read, write, and create; managers can delete products and manage shop operations.
Inventory and orders: agents can update daily operational state; managers and above own escalations.
Payments: agents can read payment state; managers and above can write payment actions such as refunds.
Services and schedulingAgent+
Customers can manage their own bookings through the portal. Agents and above can read and update booking records, services, and lifecycle actions.
Calendar, deposit, waiver, and reschedule actions should be paired with customer-path verification after permission changes.
Workspace administrationManager to Owner
Settings and analytics: managers can write settings and export analytics; admins inherit broad workspace controls.
Workspace users: managers can read membership; admins can manage users.
Workspace billing: reserved for owners in the database permission function, even though admins are otherwise broadly privileged.
Point of sale and terminalsAgent to Admin
Point of sale: agents can sell; managers can refund, void, discount, and review reports.
Cash drawer: agents can view; managers can open, close, pay in, pay out, and view.
Terminal setup: agents and managers can view; admins can register, deregister, configure, and view devices.
High-Risk Permissions
Some permissions can change money movement, access, customer data, or public launch state. Treat these as approval-sensitive:
Workspace billing
Why it is sensitive: Ownership, plan, billing liability
Recommended owner: Owner
Workspace user management
Why it is sensitive: Grants or removes access to the tenant
Recommended owner: Owner or Admin
Settings admin
Why it is sensitive: Changes workspace-wide behavior
Recommended owner: Admin
Payments write
Why it is sensitive: Refunds, payment adjustments, financial state
Recommended owner: Manager or Admin
Customer delete
Why it is sensitive: Removes customer records
Recommended owner: Admin
Product delete
Why it is sensitive: Removes sellable catalog entries
Recommended owner: Manager or Admin
POS refund/void/discount
Why it is sensitive: Changes in-person transaction outcomes
Recommended owner: Manager
Terminal configuration
Why it is sensitive: Connects payment devices
Recommended owner: Admin
Domain and sender identity
Why it is sensitive: Changes public routing and email trust
Recommended owner: Admin or Owner
Google Ads and analytics consent
Why it is sensitive: Changes tracking behavior
Recommended owner: Admin or Owner
For launch-impacting actions, pair permission with a human workflow: requested by, approved by, changed by, and verified by.
Customer Versus Operator Access
Do not blur customer portal access and console access:
/{site}/*Public visitor
Identity: Anonymous browser
Scope: Published public content and public actions
api/v1Customer
Identity: Customer session or scoped manage link
Scope: Own orders, bookings, tickets, billing, profile
/api/editor/*Operator
Identity: Console session plus selected workspace
Scope: Workspace data allowed by membership and role
/api/internal/*Internal service
Identity: Service credential or scheduled job
Scope: Specific maintenance or sync task
/api/webhooks/*Provider webhook
Identity: Provider signature or shared secret
Scope: Event-specific workspace mutation
If a customer needs help, use customer support or scoped management links. Do not promote the customer to an operator role as a shortcut.
Permission Source Of Truth
The shared permission source defines role hierarchy and wildcard grants. Database policies may also use a has_permission function, so RBAC changes need both sides to stay aligned.
Practical rules:
- Use the shared RBAC package when checking console permissions in TypeScript.
- Use database permission checks only for permissions known to the database function.
- Remember that Owner is treated as the highest privilege role.
- Remember that Admin is broadly privileged but does not receive ownership-level workspace billing in the database permission function.
- Customer portal access is enforced through customer ownership and row-level constraints, not by granting customer role checks through the console permission function.
- When a new permission category is added, update docs, UI labels, TypeScript grants, database permission behavior, and drift tests together.
Role Change Protocol
Before changing an operator role:
- Confirm the selected workspace.
- Confirm the user’s email and current role.
- Confirm the target role and reason.
- Check whether the new role grants high-risk permissions.
- Record who requested and approved the change.
- Ask the operator to refresh their session after the change.
- Verify the user can access intended routes and cannot access unintended routes.
When removing access, revoke workspace membership rather than relying on a lower role if the person should no longer operate the tenant.
Customer Portal Access
Customers use portal sessions for:
- Account overview.
- Profile.
- Notification preferences.
- Orders.
- Billing.
- Tickets.
- Saved items.
- Booking history.
- Reschedule and manage flows.
Portal sessions should only expose records linked to the authenticated customer or a scoped capability link.
Public Capability Links
Some customer actions may use scoped links, such as a booking manage link or payment link. Treat these links as sensitive. They should:
- Scope access to one customer action.
- Avoid exposing unrelated customer records.
- Expire or become unusable when the underlying action is complete when possible.
- Avoid passing sensitive tokens to analytics or advertising tools.
Access Troubleshooting
Operator sees wrong data
Selected workspace, membership, browser session
Operator cannot open a section
Role, feature flag, workspace status
Customer cannot sign in
Portal session, email, callback route, domain
Customer sees no orders/bookings
Customer record linkage, guest claim flow, workspace scope
Admin route redirects unexpectedly
Auth session, selected workspace cookie, membership check
Safe Operating Rule
When access looks wrong, do not work around it by changing public-site code. Confirm identity, workspace, role, and tenant scope first.
Escalate access issues with the user email, workspace slug, intended role, current route, and timestamp. That packet helps separate a real permissions defect from a stale session, wrong workspace selection, or expected least-privilege restriction.