From 63c84a4b87c0ca3b05eac40a05d472e5801a8686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BENEDEK=20L=C3=A1szl=C3=B3?= Date: Thu, 5 Jun 2025 14:34:38 +0200 Subject: [PATCH] list channels --- postgres/40-views.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 postgres/40-views.sql diff --git a/postgres/40-views.sql b/postgres/40-views.sql new file mode 100644 index 0000000..4c3e839 --- /dev/null +++ b/postgres/40-views.sql @@ -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"; \ No newline at end of file