SVN::Access::Resource - Object representing a SVN Access file resource


SVN-Access documentation  | view source Contained in the SVN-Access distribution.

Index


NAME

Top

SVN::Access::Resource - Object representing a SVN Access file resource

SYNOPSIS

Top

  use SVN::Access;

  my $acl = SVN::Access->new(acl_file => '/usr/local/svn/conf/badnews_svn_access.conf');

  # grant mikey_g read-write access to /
  $acl->resource('/')->authorize('mikey_g', rw);

  # print out users and their authorization for /
  while (my ($user, $perms) = each(%{$acl->resource('/')->authorized})) {
      print "$user: $perms\n";    
  }

  # revoke access for mikey_g to /
  $acl->resource->('/')->deauthorize('mikey_g');

DESCRIPTION

Top

SVN::Access::Resource is an object wrapper around a SVN::Access resource.

METHODS

Top

new

constructor, the most basic kind, i'm only looking for authorized (hashref), and name.

Example:

  my $resource = SVN::Access::Resource->new(
      name => '/',
      authorized => {
          rick => 'rw', # commit access..
          randal => 'r', # read only access
          luthor => '', # explicitly deny access
      }
  );

authorized

returns a hash reference containing (user, access) pairs.

Example:

  my %authorized = %{$resource->authorized};

authorize

authorizes a user / group for access to this resource. note: if an integer is passed as the last argument, SVN::Access will attempt to store your permissions at that place in the authorized hash.

Example:

  $resource->authorize('@admins' => 'rw'); # give the admins commit
  $resource->authorize('*', => 'r'); # give anonymous read only

deauthorize

revokes the user / group's access to this resource.

Example:

  $resource->deauthorize('rick'); # later, rick.

name

accessor method that returns the resource's name (path)

SEE ALSO

Top

subversion (http://subversion.tigris.org/), SVN::ACL, svnserve.conf

AUTHOR

Top

Michael Gregorowicz, <mike@mg2.org>

COPYRIGHT AND LICENSE

Top


SVN-Access documentation  | view source Contained in the SVN-Access distribution.