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

Rozsireni ACL o delsi opravneni

parent 4ef2be69
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ __PACKAGE__->add_columns(
},
qw(
stream_id
rights
class
value
),
......
......@@ -9,17 +9,17 @@ sub user_acl {
my $class = shift;
my $user = shift;
my $grants = {};
my $rights = {};
# verejne streamy
my $streams = $class->result_source->schema->resultset('Stream')->search(
{ is_public => 1 }
{ is_public => 't' }
);
STREAM:
while ( my $stream = $streams->next ) {
$grants->{ $stream->key} = 1; #TODO: read|write
$rights->{ $stream->key } = 4;
}
# na zaklade clenstvi ve skupine, role nebo user.id
......@@ -49,13 +49,12 @@ sub user_acl {
}
);
ACL:
while ( my $acl = $acls->next ) {
$grants->{ $acl->stream->key} = 1; #TODO: read|write
$rights->{ $acl->stream->key } |= $acl->rights;
}
return $grants;
return $rights;
}
......
......@@ -28,6 +28,7 @@ create table "streams" (
create table "acl" (
"id" integer not null default nextval('uid_seq'),
"stream_id" integer not null,
"rights" smallint, -- 4 - play, 2 - push, 1 - admin
"class" text,
"value" text,
primary key("id"),
......@@ -51,3 +52,4 @@ drop sequence "uid_seq";
-- 2 up
alter table "streams" add "description" text;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment