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

Pridana metoda is_editable, signatures

parent 3a2e8111
Branches
Tags
No related merge requests found
......@@ -2,6 +2,8 @@ package PiTube::Schema::Result::Record;
use strict;
use warnings;
use feature 'signatures';
no warnings qw{ experimental::signatures };
use base 'DBIx::Class::Core';
......@@ -39,13 +41,14 @@ __PACKAGE__->belongs_to(
);
__PACKAGE__->set_primary_key('id');
sub is_editable ($self, $user_id=0) {
return $user_id == $self->publish_user_id;
}
sub is_deletable {
my $self = shift;
my $user_id = shift // 0;
sub is_deletable ($self, $user_id=0) {
return 0 if $self->is_protected;
return $user_id == $self->publish_user_id;
}
1;
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment