From: Tara L Andrews Date: Wed, 11 Jul 2012 19:33:51 +0000 (+0200) Subject: incorporate user auth functionality X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fc5c4949b38572067ab389afa8c1cafec2b5dbd0;p=scpubgit%2Fstemmatology.git incorporate user auth functionality --- fc5c4949b38572067ab389afa8c1cafec2b5dbd0 diff --cc lib/Text/Tradition.pm index c2c49c1,e135da9..ce64e1d --- a/lib/Text/Tradition.pm +++ b/lib/Text/Tradition.pm @@@ -53,14 -54,22 +54,29 @@@ has 'stemmata' => }, default => sub { [] }, ); + +has '_initialized' => ( + is => 'ro', + isa => 'Bool', + default => undef, + writer => '_init_done', + ); + has 'user' => ( + is => 'rw', + isa => 'Text::Tradition::User', + required => 0, + predicate => 'has_user', + clearer => 'clear_user', + ); + + has 'public' => ( + is => 'rw', + isa => 'Bool', + required => 0, + default => sub { 0; }, + ); + # Create the witness before trying to add it around 'add_witness' => sub { my $orig = shift; diff --cc lib/Text/Tradition/Directory.pm index 9472b46,e073503..dfbbeee --- a/lib/Text/Tradition/Directory.pm +++ b/lib/Text/Tradition/Directory.pm @@@ -194,8 -221,8 +224,9 @@@ around BUILDARGS => sub return $class->$orig( $args ); }; + ## These checks don't cover store($id, $obj) -before [ qw/ store update insert delete / ] => sub { +# before [ qw/ store update insert delete / ] => sub { +before [ qw/ delete / ] => sub { my $self = shift; my @nontrad; foreach my $obj ( @_ ) {