summaryrefslogtreecommitdiff
path: root/usr/src/pinyadmin/bin/lsaccess
blob: b55900cf78a250fb682c7b2182a16f1e8a579650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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( $reponame );

  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";
    };
  };

};