users
Dashboard team members. Each carries account_id and a seat (admin or member), optionally
plus a custom role, and may hold narrower roles per workspace or per project.
uMarker runs many tenants inside one Laravel application and one database. Isolation is not an add-on package: it is a trait plus a global scope, deliberately kept small so it is easy to audit and hard to get wrong. This page describes exactly how a request is confined to one tenant, the two layers that narrow it further inside the tenant, and how all of it is re-checked on the server.
Every tenant is an account. The core entities hang off it:
users
Dashboard team members. Each carries account_id and a seat (admin or member), optionally
plus a custom role, and may hold narrower roles per workspace or per project.
widget_users
Browser-extension tester identities (token auth). Carry account_id, are revocable and
deletable, and are linked many-to-many to the projects they may capture on.
projects
Carry account_id, a workspace_id, a widget_visible publish switch, a public_key, and
their own allowed domains. Own their widget settings and their feedback.
feedback + related
Reports and everything that decorates them (pins, comments, labels, surveys, announcements,
API keys, saved views, custom fields) all carry account_id. Bell notifications are the one
exception: they are keyed to the person who receives them, not to the account, so a read only
ever reaches that one teammate’s rows.
Tenant-owned models use the BelongsToAccount trait. It does two things and nothing more:
Auto-scopes every query. A global scope named account adds a
where account_id = <current account> to every query the model runs, so a query can only ever see
the current tenant’s rows.
Auto-fills on create. When a new record is created without an account_id, the trait fills it
from the current account, so a developer can’t accidentally write an unscoped row.
The “current account” comes from a single resolver, Tenancy::currentAccountId(). It reads the
authenticated principal: a dashboard User, or a WidgetUser on the token guard, both of which
carry account_id. The auth principals themselves are not account-scoped (otherwise the resolver
would recurse), so ownership on those is checked explicitly instead.
Two records (users and widget_users) are intentionally left out of the global account scope,
because they are the auth principals the resolver itself reads — scoping them would make it recurse.
For those, ownership is enforced by an explicit check: a request for one that belongs to another
account is answered with a 404, never another tenant’s data. invitations are scoped like
everything else and re-checked explicitly on top, because the accept flow runs before a tenant is
established. The rule is the same everywhere: fail closed.
A workspace groups projects inside one account, in an Account → Workspace → Project hierarchy. A new
account is created with workspaces on and one workspace called General; every project belongs to
a workspace, so workspace_id is never NULL and there is no unassigned limbo.
When a dashboard request carries an X-Workspace-Id header, a second global scope hard-filters
Project, Feedback, labels and the rest to that one workspace. With no header it falls back to
the reader’s full accessible set. The public widget, API keys and queue jobs are never workspace-
scoped. The header is a dashboard-navigation fact, not a credential.
Inside a workspace, reach is decided per project: a member sees exactly the projects they are
attached to (project_user). Attachment is access. Three exemptions are deliberate and all three are
explicit rather than implied: account admins — the admin seat, of which an account may hold several
— and platform operators reach everything; a role holding the workspaces.allprojects permission may
open every project in its workspace without being attached to each one; and switching multi-space
mode off for the account removes the workspace layer and this per-project layer in one go, so every
member reaches every project.
Reach and permission are separate axes, and both are asked. The list of projects whose reports a
person may read is “reachable and granted feedback.view for that project”, asked per project so
a per-project role override can decide, which means a project-level role can widen or narrow what
a workspace role gave.
| Situation | Reach |
|---|---|
| Account admin or platform operator | Every project |
Role with workspaces.allprojects |
Every project in the workspace |
| Member attached to projects | Only those projects |
| Member attached to nothing | No projects; an empty list is a valid answer |
| Multi-space mode off for the account | Every project, for every member — no row above applies |
| Public widget / API key / queue context | Not applicable: these layers never apply |
Client-side state is never trusted on its own. The widget and extension gate their own visibility for UX; the server re-derives every access decision from scratch.
Config / visibility. When the widget asks whether it should appear, the server checks the page’s origin against the project’s allowed domains, resolves the page URL to a project, confirms the project is published, and confirms the caller is authorized for it. Anything else returns hidden, with no project or settings payload attached.
Ingest. When a report is submitted, the ingest endpoint re-derives the decision for itself rather than trusting what config told the client — but the two surfaces are checked differently. The snippet’s ingest re-resolves the public key and re-checks the calling origin against your allowed domains as they stand at that moment. The extension’s ingest checks the tester’s identity and their assignment to that project instead, and deliberately does not require the page’s host to be one of your listed domains: that is what lets a tester capture on a staging host you never listed. On both, the account written onto the new report is taken from the server-side resolution, never from the request body.
Media read-back. Screenshots fetched through the dashboard API bind through an account-scoped
model, so a request for another tenant’s file resolves to a 404 rather than the bytes, and they
additionally require the separate feedback.download permission — reading a report and taking its
files away are different rights. The media gallery is the other path, and it is gated on
feedback.gallery instead: it hands the browser a signed URL that expires in six hours, because
an <img src> cannot carry a bearer token. A third path leaves the account altogether — the
screenshot link uMarker writes into a Jira ticket, a Slack message or a webhook payload, where the
signature is the access control and there is no session to check. See
Storage & media for how long those live.
Security-relevant events are recorded in audit_logs through one Audit helper. Each row captures
the action, the acting user_id or widget_user_id, the account_id, an optional
subject_type/subject_id, freeform meta, and a timestamp. Recorded actions include tester
issuance and revocation, widget key rotation and revocation, report creation and deletion, status and
assignment changes, retention changes, account export, plan changes, and support sign-ins. A widget
key is minted as part of creating or publishing a project, so what the log shows for that is
project.created or project.published — there is no separate “key issued” row.
Rows are pruned on two windows rather than one, and which window a row gets is decided by what kind of event it is, not by how old it is. Accountability events are kept the longest: impersonation, suspension, deletion, plan and entitlement changes, role and invite changes, and tester credential issuance and revocation. Everything else is treated as activity and shed sooner: sign-ins, which are most of the volume, and ordinary content edits — and that second group also holds API key creation and revocation, widget key rotation and revocation, and turning two-factor off. An API key outlives its own audit row — the key itself records when it was minted and by whom, revoked or not, so that question stays answerable on the API keys page, and only the name goes blank if that person is later deleted. A widget key rotation does not: nothing on the project records who rotated it, so once that row is shed the answer is gone. Export before the shorter window closes if that history matters to you. Both windows are set per deployment, so ask us for the numbers on yours. The whole table is included in your data export, so the history is yours to take.