summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin/addaccess
blob: e3511145e9f5ec0e4337cc7b28a81b2a757ca4d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;
use warnings;

use Piny;

my $env = Piny::Environment->instance( );

my ( $reponame, @users ) = @ARGV;

my $repo = Piny::Repo->new( $reponame );

if ( $repo->owner->uid != $env->user->uid ) {
  print "You are not the owner of that repo!\n";
  exit( 3 );
};

$repo->add_access( map { Piny::User->new( $_ ) } @users );