NARCISO
04/01/2022, 2:22 PMMessage
table:
CREATE TABLE IF NOT EXISTS public.message
(
id uuid NOT NULL,
sender_user_id uuid NOT NULL,
recipient_user_id uuid NOT NULL,
conversation_id uuid NOT NULL,
content text COLLATE pg_catalog."default" NOT NULL,
read boolean DEFAULT false,
message_warning boolean DEFAULT false,
CONSTRAINT message_pkey PRIMARY KEY (id),
CONSTRAINT message_conversation_id_fkey FOREIGN KEY (conversation_id)
REFERENCES public.conversation (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE RESTRICT,
CONSTRAINT message_sender_user_id_fkey FOREIGN KEY (sender_user_id)
REFERENCES public."user" (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE RESTRICT,
)
The table is pretty simple but I have some the need of some "custom" Column Level Security
.
For example, I would like to let the user, through a RLS Policy
, to only UPDATE the content
and the read
column.
As far as I know this is not possible through a RLS Policy
.
Is there any other way to do this? or what's the best way to do this? maybe without using a db function
?
Thanks!garyaustin
04/01/2022, 3:03 PMsilentworks
04/01/2022, 3:07 PMNARCISO
04/01/2022, 6:28 PMNARCISO
04/01/2022, 6:28 PM