1 package Girocco
::ProjPerm
;
3 # This is base class for various permission models; these control updating
4 # permissions of appropriate files in push-enabled repositories.
5 # The /etc/group file is maintained by Girocco::Project itself.
7 # The chosen subclass of this class is used as base class of Girocco::Project.
15 our @interesting = qw(refs info objects);
24 my ($proj, $username, $uid) = @_;
29 my ($proj, $username, $uid) = @_;
35 # The --shared= argument for git init
42 package Girocco
::ProjPerm
::Group
;
44 # This is the naive permission model: on init, we just chgrp the relevant
45 # pieces to our group and make them group-writable. But oh, we cannot do that
46 # since we are not root; so we just sit happily and do nothing else.
47 # Then, we can just sit happily and do nothing else either.
53 use base
qw(Girocco::ProjPerm);
62 my ($proj, $username, $uid) = @_;
67 my ($proj, $username, $uid) = @_;
79 package Girocco
::ProjPerm
::Hooks
;
81 # This is the "soft-security" permission model: we keep the repository
82 # world-writable and check if the user is allowed to push only within
83 # the update hook that will call our can_user_push() method.
89 use base
qw(Girocco::ProjPerm);
98 my ($proj, $username, $uid) = @_;
103 my ($proj, $username, $uid) = @_;
113 my ($proj, $username) = @_;
114 grep { $_ eq $username } @
{$proj->{users
}};