You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Step 5: membership inside the company row policy, as basejump's has_role_on_account #66
Founder's word on step 5's native audit (item 2.9), 2026-10-17: "Passo 5: A". company_all keeps checking only the scope's company (decision 0039, security S7), and this issue records the alternative.
Today the COMPANY scope opens with the company from the address, before admission. The row policy checks company_id = conexus.company_id and not that the person is a member. Admission in code decides membership (identity/admission.ts, through the plugin's defaultRoles[role].authorize). The policy guards against a forgotten filter (criterion B3), not a forgotten admission.
basejump puts membership in the policy itself with a SECURITY DEFINERhas_role_on_account() (supabase/migrations/20240414161947_basejump-accounts.sql:252-271).
Obstacle: the operator invites a company's first owner in the COMPANY scope of a company with no member (admission.ts). A membership policy would refuse that, so the operator's path needs its own scope or check first.
Trigger: the founder asks for membership in the database too, or a route opens a COMPANY scope where admission could be skipped.
Activity