mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-29 09:10:58 +01:00
In self-hosted multi-organization mode the tenant check let every signed-in session or proxy user into the default organization, so a user invited only to another organization could read the default estate by selecting it with the org header or cookie. The default organization is now open there only to instance administrators (local admin, an RBAC admin grant evaluated with inheritance and deny precedence, or a proxy user admitted with the admin role) and to explicit members recorded in its org.json, loaded strictly. Having no other membership is never treated as access. Single-tenant and hosted runtimes keep the open default organization. One context-aware policy now serves tenant selection, action authority, the organization handlers and the WebSocket hub, which also checks the default organization. WebSocket, SSE and agent-event streams re-check it every 10 seconds, so revoked access ends live reads. Handlers that re-derive the org from the request now follow the authorized org. A request that names no organization lands in the user's first organization. A refused default selection answers default_org_access_denied; the browser clears it and retries reads only. A user with no usable organization sees their pending invitations instead of a connection failure. Instance administrators manage default members from Organization access. Members are viewers, membership is the only entitlement (an owner field grants nothing), and every save of the default organization keeps its current members, so a share or invitation change made from an older snapshot cannot restore a revoked one. The first start in this mode seeds RBAC-assigned users who belong to no other organization, and retries rather than completing on unreadable tenant metadata or RBAC data. Listing an organization's invitations now returns [] instead of null when none are pending; the Organization access panel rejected null and showed "Organization access unavailable" to any org admin without pending invitations.