Deprecated RLS features
auth.role()#
🌐 The auth.role() function is now deprecated
auth.role() 函数已经被废弃,建议使用在 Postgres 中原生支持的 TO 字段:
🌐 The auth.role() function has been deprecated in favour of using the TO field, natively supported within Postgres:
1-- DEPRECATED2create policy "Public profiles are viewable by everyone."3on profiles for select using (4 auth.role() = 'authenticated' or auth.role() = 'anon'5);67-- RECOMMENDED8create policy "Public profiles are viewable by everyone."9on profiles for select10to authenticated, anon11using (12 true13);auth.email()#
🌐 The auth.email() function is now deprecated
auth.email() 函数已被弃用,建议使用一个更通用的函数来返回完整的 JWT:
🌐 The auth.email() function has been deprecated in favour a more generic function to return the full JWT:
1- DEPRECATED2create policy "User can view their profile."3on profiles for select using (4 auth.email() = email5);67-- RECOMMENDED8create policy "User can view their profile."9on profiles for select using (10 (auth.jwt() ->> 'email') = email11);