list channels
This commit is contained in:
parent
7603575aa9
commit
63c84a4b87
18
postgres/40-views.sql
Normal file
18
postgres/40-views.sql
Normal 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";
|
Loading…
Reference in New Issue
Block a user