make sure all tests work in all combos, save the broken Directory deletion; POD doc...
[scpubgit/stemmatology.git] / persistence / lib / Text / Tradition / Ownership.pm
1 package Text::Tradition::Ownership;
2
3 use strict;
4 use warnings;
5 use Moose::Role;
6 use Text::Tradition::User;
7
8 requires 'throw';
9
10 =head1 NAME
11
12 Text::Tradition::Ownership - add-on role to enable Text::Tradition objects
13 to have users who own them.
14
15 =head1 METHODS
16
17 =head2 user
18
19 Accessor for the owner of the tradition.
20
21 =head2 public
22
23 Whether this tradition should be accessible (readonly) to anyone who is not
24 the owner.
25
26 =cut
27
28 has 'user' => (
29     is => 'rw',
30     isa => 'Text::Tradition::User',
31     required => 0,
32     predicate => 'has_user',
33     clearer => 'clear_user',
34     weak_ref => 1
35     );
36
37 has 'public' => (
38     is => 'rw',
39     isa => 'Bool',
40     required => 0,
41     default => sub { 0; },
42     );
43
44     
45 1;
46