Repository navigation
Commit 96fe30e
fix(projects): replace name-based founder override with role_id check
getUserProjects previously granted global admin project access via a
hardcoded first_name + last_name match. Any codev row matching those
strings would silently inherit founder scope — a backdoor.
Replace with role_id === 1 (Admin), matching the convention used
across the codebase (admin-dashboard, Navbar, surveys/actions, etc.).
Also swap the .or() interpolation that mixed user-controlled email
into PostgREST grammar for two parameterized .eq() lookups (id-first,
email fallback for legacy rows seeded before auth.users.id was linked).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8c3b782 commit 96fe30e
1 file changed
Lines changed: 25 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | | - | |
83 | | - | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| |||
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
133 | | - | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
0 commit comments