From 5e4e9675d39413c22568100372bc82f07495a700 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 29 Jun 2010 22:38:57 -0700 Subject: First run at lsaccess and lsrepo. --- usr/src/pinyadmin/bin/lsaccess | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 usr/src/pinyadmin/bin/lsaccess (limited to 'usr/src/pinyadmin/bin/lsaccess') diff --git a/usr/src/pinyadmin/bin/lsaccess b/usr/src/pinyadmin/bin/lsaccess new file mode 100755 index 0000000..eb7b6bc --- /dev/null +++ b/usr/src/pinyadmin/bin/lsaccess @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Piny; + +my $env = Piny::Environment->new( ); + +my ( $reponame ) = @ARGV; + +if ( defined $reponame ) { + + my $repo = Piny::Repo->new( $repo ); + + foreach my $user ( Piny::User->all_users( ) ) { + if ( $repo->has_access( $user ) ) { + print $user->name . "\n"; + }; + }; + +} else { + + foreach my $repo ( Piny::Repo->all_repos( ) ) { + if ( $repo->has_access( $env->user ) ) { + print $repo->name . "\n"; + }; + }; + +}; -- cgit v1.2.3