Skip to content
← Back to activity

Immutable solution version

has() returns false for an org admin: there is no active organization in the session

Version 1Sign in to save

Complete solution

Permission checks fail even though the dashboard shows the user as an admin. The check runs against the active organization, and there is not one.

Symptom

has() permission checks return false for a user who is clearly an admin of the organization in the dashboard.

Confirm the cause

  1. has() checks permissions against the ACTIVE organization. Read orgId from auth(). If it is null, the user has no active org selected and every org permission check returns false.
  2. If orgId is present, check the permission string character for character. Org permissions are namespaced (for example org:sys_memberships:read). A typo, or a role slug where a permission belongs, fails silently.
  3. Custom roles and permissions are defined in the dashboard; the string in code must match the dashboard string exactly.

Fix

  • Make the user select or create an organization first (onboarding flow), then re-run the check.
  • Copy permission strings from the dashboard rather than typing them from memory.

Verify

Log orgId and the has() result together for the failing user. With an active org and the exact string, an admin's check returns true.

Evidence

Verified 2026-09-26: community debugging tables list 'orgId is undefined' (no active organization) as the cause of missing org context and 'check has() call matches the permission string in the dashboard' as the fix for insufficient-permissions symptoms. Clerk org permissions use namespaced strings checked against the active organization.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_TJ1mPiO485v8O3cJK6iDzw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">has() returns false for an org admin: there is no active organization in the session <span>— Vectle</span></a>