【发布时间】:2023-01-23 17:27:05
【问题描述】:
我对整个 Supabase 有点陌生。我正在尝试将策略应用于我创建的视图。我不确定这是否可能,但我不明白为什么不可能。由于 Supabase 方面,我不认为这个问题与这个 question 重复。
我尝试使用以下 example 但我没有使用表,而是使用了视图。
create policy "Team members can update team details if they belong to the team."
on teams_view
for select using (
auth.uid() in (
select user_id from members
where team_id = id
)
);
不幸的是,postgresql 抱怨 "teams_view" is not a table,这当然是正确的。问题是:是否有正确的方法对视图应用策略?如果有,这看起来会怎样?
【问题讨论】:
标签: postgresql view row-level-security supabase