list channels

This commit is contained in:
BENEDEK László 2025-06-05 14:34:38 +02:00
parent 7603575aa9
commit 63c84a4b87

18
postgres/40-views.sql Normal file
View File

@ -0,0 +1,18 @@
create or replace view "user_rigths_per_channel" as
select distinct
"u"."id" as "user_id",
"c"."id" as "channel_id",
"c"."name" as "channel_name",
"c"."description" as "channel_description",
"r"."rights"
from
"user" "u"
join
"role_binding" "rb" on "u"."id" = "rb"."user_id"
join
"role" "ro" on "rb"."role_id" = "ro"."id"
join
"right" "r" on "ro"."id" = "r"."role_id"
join
"channel" "c" on "r"."channel_id" = "c"."id"
order by "user_id";