diff --git a/lib/PiTube/Controller/Stream.pm b/lib/PiTube/Controller/Stream.pm index aabb5b05352b23d5691b56c3ee9446ee6ccd9a25..6b1ffa234fa3da6359f47b6ee3d54b371c12c3c5 100644 --- a/lib/PiTube/Controller/Stream.pm +++ b/lib/PiTube/Controller/Stream.pm @@ -25,7 +25,11 @@ sub list { STREAM: while ( my $stream = $streams->next()) { - my $rights = $c->session->{user}{acl}{ $stream->key } || next STREAM; + my $rights = $c->session->{user}{acl}{ $stream->key }; + + if ( ! $stream->is_public ) { + next STREAM if ! $rights; + } my %stream = ( $stream->get_columns(), diff --git a/templates/index.html.ep b/templates/index.html.ep index 45a12ad92d48b9750922dd2d1fe80402d18cad7f..7086ef85c83d038d921e9a43f16ca9798dd31ddb 100644 --- a/templates/index.html.ep +++ b/templates/index.html.ep @@ -32,7 +32,11 @@ $('#Streams').bootstrapTable({ }); function streamInfoAllowed(index, row) { +% if ( $c->is_user_authenticated) { return row.is_live ? 0 : 1; +% } else { + return 0; +% } } function streamInfo(index, row, element) {