Organisations, members and roles

How organisations, invitations and member roles work, how the app-wide admin and viewer roles differ, and the rules that stop a team losing its owner.

Updated · 3 min read

Every account works inside an organisation. Owners and admins invite people by email or link and give each member a role. Billing and the affiliate program hang off organisations, so a plan belongs to the team, not to one person. Separately, any user can be an app admin, which opens the admin panel.

Organisations

Users create organisations during onboarding or at /organisations. Each sign-in lands in an organisation: a new session picks the user's earliest membership if none is active. The organisation switcher in the sidebar moves between them.

/organisations lists the user's organisations with their members and invitations. Adding ?organisationId= to the address selects one, so a link can point straight at a team.

An organisation with an open subscription can't be deleted. The owner sees "Cancel this organisation's subscription in billing before deleting it." Cancel in billing first, then delete.

Member roles

RoleCan do
OwnerEverything, including billing and deleting the organisation
AdminInvite and manage members, change billing, see invoices
MemberUse the organisation, see its plan, limits and any failed payment

Only owners and admins change an organisation's plan or see its invoices. The server checks this on every request, not only the web app.

An organisation always keeps at least one owner. The database refuses to remove or demote the final owner, and a user who is the only owner of an organisation can't delete their account.

Invitations

Owners and admins invite people from the organisation page. With LOOPS_API_KEY and LOOPS_INVITATION_TEMPLATE_ID set, the invitation arrives by email. Without them, the invitation is still created and owners and admins copy its link from the organisation page and share it themselves. The link has the form https://<your domain>/invitations/<id>.

The invitee signs in, or signs up, and accepts or rejects the invitation at that address. Accepting needs a verified email, so someone who registered an address they don't own can't join a team through it. During onboarding, a pending invitation shows up as the first choice on the workspace step.

App admins and viewers

Separate from organisation roles, every user has an app-wide role:

App roleWhat it opens
userThe product. This is the default.
adminThe admin panel at /admin, with full control.
viewerThe admin panel, read-only. A viewer can look at everything an admin sees and change nothing, including their own account.

The first admin is set in the database, because no sign-up or profile request can set a role:

UPDATE "user" SET role = 'admin' WHERE email = 'owner@example.com';

After that, admins change other users' roles in Admin → Users. Admins can't change their own role, so the last admin can't lock everyone out. See Run it locally and Deploy to Railway for where to run the SQL.

The viewer role suits a public demo. Make a demo account a viewer, then set DEMO_EMAIL and DEMO_PASSWORD on the server, and the sign-in page shows a "Sign in to the demo" button. It only appears while that account's role is viewer, so pointing it at an admin shows nothing. Viewers can sign in, sign out and switch organisation, but can't turn on two-factor or add a passkey, so one visitor can't lock the others out.

Acting on users

From Admin → Users an admin can:

  • Impersonate a user to see what they see, for up to 60 minutes, after giving a reason. A banner shows who and how long is left, with "Stop impersonating". Admins can't be impersonated, and while impersonating you can't change how that person signs in, delete their account or an organisation, or touch billing and payouts.
  • Ban a user for 1, 7 or 30 days or until lifted. Banning ends their sessions, and their sign-in is refused with "This account is suspended."
  • Sign out everywhere, or end one session.

Every one of these is written to the audit log. See The admin panel.

Authorise on the server

When you add your own features, check membership and roles on the server. Hiding a button in the web app is not access control. The starter's billing routes are the model: any member reads the plan, only owners and admins change it, non-members get 403 and signed-out requests get 401.

Something unclear or missing? Ask us and we'll answer, then fix the page.