File: | lib/Yukki/Settings/Privileges.pm |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Yukki::Settings::Privileges; | ||||||
2 | |||||||
3 | 4 4 | 1107 20 | use v5.24; | ||||
4 | 4 4 4 | 30 6 18 | use utf8; | ||||
5 | 4 4 4 | 100 13 35 | use Moo; | ||||
6 | |||||||
7 | 4 4 4 | 1081 8 18 | use Types::Standard qw( ArrayRef Str ); | ||||
8 | 4 4 4 | 2789 7 34 | use Yukki::Types qw( AccessLevel ); | ||||
9 | |||||||
10 | 4 4 4 | 1403 5 18 | use namespace::clean; | ||||
11 | |||||||
12 | # ABSTRACT: settings describing privileges | ||||||
13 | |||||||
14 - 24 | =head1 DESCRIPTION This just encapsultate privilege requirements to do certain actions. =head1 ATTRIBUTES =head2 anonymous_access_level This should be set to one of the following: read, write, or none. This settings decides how much access an anonymous user has when visiting your wiki. =cut | ||||||
25 | |||||||
26 | has anonymous_access_level => ( | ||||||
27 | is => 'ro', | ||||||
28 | isa => Yukki::Types::AccessLevel, | ||||||
29 | required => 1, | ||||||
30 | default => 'none', | ||||||
31 | ); | ||||||
32 | |||||||
33 - 41 | =head2 read_groups This may be set to the word "ANY" or the word "NONE" or to an array of group names. If set to ANY, any logged user may read this repository. If set to NONE, read access is not granted to any logged user (though if C<anonymous_access_level> or C<write_groups> grant a user access, the user will be able to read the repository). If an array of one or more group names are given, the users with any of those groups will be able to read the repository. =cut | ||||||
42 | |||||||
43 | has read_groups => ( | ||||||
44 | is => 'ro', | ||||||
45 | isa => Str|ArrayRef[Str], | ||||||
46 | required => 1, | ||||||
47 | default => 'NONE', | ||||||
48 | ); | ||||||
49 | |||||||
50 - 54 | =head2 write_groups THe possible values that may be set are identicl to C<read_groups>. This setting determines who has permission to edit pages and upload files to the repository. =cut | ||||||
55 | |||||||
56 | has write_groups => ( | ||||||
57 | is => 'ro', | ||||||
58 | isa => Str|ArrayRef[Str], | ||||||
59 | required => 1, | ||||||
60 | default => 'NONE', | ||||||
61 | ); | ||||||
62 | |||||||
63 | 1; | ||||||
64 |