-- ═══════════════════════════════════════════════════════════════ -- 047 ACCESS BY GOOGLE GROUP -- -- Admin access from Google Workspace groups (accessGroups.js). -- Panel → Site settings → Access names a group for each of viewer, -- editor and admin. Someone in one of them who signs in with Google -- gets an account with the highest of those roles, and keeps it only -- while they're in the group. Superadmins and admin-cli accounts are -- never touched. -- -- admin_users.access_source 'manual' (admin-cli, the Panel) or -- 'group' (made by a group sign-in; -- Google only, role follows the group) -- admin_users.group_disabled 1 when a group check turned it off -- (back in a group turns it on again); -- a superadmin's Disable sets 0, and -- that one sticks -- admin_users.groups_checked_at the last group check, UTC -- ═══════════════════════════════════════════════════════════════ ALTER TABLE admin_users ADD COLUMN access_source TEXT NOT NULL DEFAULT 'manual' CHECK (access_source IN ('manual', 'group')); ALTER TABLE admin_users ADD COLUMN group_disabled INTEGER NOT NULL DEFAULT 0 CHECK (group_disabled IN (0, 1)); ALTER TABLE admin_users ADD COLUMN groups_checked_at TEXT; ALTER TABLE site_settings ADD COLUMN access_group_viewer TEXT; ALTER TABLE site_settings ADD COLUMN access_group_editor TEXT; ALTER TABLE site_settings ADD COLUMN access_group_admin TEXT;