Skip to content
Snippets Groups Projects
Verified Commit 16c228d4 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Zapracovana ACL

parent 518cd8f9
No related branches found
No related tags found
No related merge requests found
......@@ -20,8 +20,26 @@ sub list {
{ order_by => 'name' }
);
$c->stash->{streams} = $streams;
my @streams = ();
STREAM:
while ( my $stream = $streams->next()) {
my $rights = $c->session->{user}{acl}{ $stream->key };
next STREAM if ! $rights;
push @streams, {
is_live => $stream->is_live,
key => $stream->key,
name => $stream->name,
publisher => $stream->is_live ? $stream->publish_user_name : '',
is_writeable => $c->is('publisher')
&& $stream->is_writeable( $rights ),
is_recordable => $c->is('publisher')
&& $stream->is_recordable( $c->session->{user}{username} ),
};
}
$c->stash->{streams} = \@streams;
}
......@@ -45,7 +63,7 @@ sub player {
$c->stash->{stream} = $stream;
if ( ! $c->session->{user}{acl}{ $stream->key } ) {
if ( ! ( $c->session->{user}{acl}{ $stream->key } & 4 ) ) { # TODO:constant
$c->render('stream/403');
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment