diff options
Diffstat (limited to 'perl/lib')
| -rw-r--r-- | perl/lib/Wallet/Report.pm | 38 | 
1 files changed, 38 insertions, 0 deletions
| diff --git a/perl/lib/Wallet/Report.pm b/perl/lib/Wallet/Report.pm index 912bc17..4d92d64 100644 --- a/perl/lib/Wallet/Report.pm +++ b/perl/lib/Wallet/Report.pm @@ -285,6 +285,27 @@ sub objects_history {  }  ############################################################################## +# Type reports +############################################################################## + +# Return an alphabetical list of all valid types set up, along with the class +# that they belong to. +sub types { +    my ($self) = @_; + +    my (@types); +    my @types_rs = $self->{schema}->resultset('Type')->all; +    for my $type_rs (@types_rs) { +        my $name  = $type_rs->ty_name; +        my $class = $type_rs->ty_class; +        push(@types, [ $name, $class ]); +    } + +    @types = sort { $a->[0] cmp $b->[0] } @types; +    return @types; +} + +##############################################################################  # ACL reports  ############################################################################## @@ -527,6 +548,23 @@ sub owners {      return @owners;  } +# Return an alphabetical list of all valid types set up, along with the class +# that they belong to. +sub acl_schemes { +    my ($self) = @_; + +    my (@schemes); +    my @acls_rs = $self->{schema}->resultset('AclScheme')->all; +    for my $acl_rs (@acls_rs) { +        my $name  = $acl_rs->as_name; +        my $class = $acl_rs->as_class; +        push(@schemes, [ $name, $class ]); +    } + +    @schemes = sort { $a->[0] cmp $b->[0] } @schemes; +    return @schemes; +} +  ##############################################################################  # Auditing  ############################################################################## | 
