GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SVN::ACCESS (3)

.ds Aq ’

NAME

SVN::Access - Perl extension to manipulate SVN Access files

CONTENTS

SYNOPSIS



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

  # add a group to the config
  $acl->add_group(stooges, qw/larry curly moe shemp/);

  # write out the acl (thanks Gil)
  $acl->write_acl;

  # give the stooges commit access to the production version of
  # our prized intellectual property, the free car giver-awayer..
  # (thats how we get users to the site.)
  $acl->add_resource(
      # resource path
      /free_car_giver_awayer/branches/prod_1.21-sammy_hagar,

      # permissions
      @stooges => rw,
  );

  $acl->write_pretty; # with the equals signs all lined up.



DESCRIPTION

<B>SVN::AccessB> includes both an object oriented interface for manipulating SVN access files (AuthzSVNAccessFile files), as well as a command line interface to that object oriented programming interface (<B>svnaclmgr.plB>) in the examples/ directory.

METHODS

<B>newB> the constructor, takes key / value pairs. only one is required.. in fact only one is used right now. acl_file.

Example:



  my $acl = SVN::Access->new(acl_file   =>  /path/to/my/acl.conf);



<B>add_resourceB> adds a resource to the current acl object structure. note: the changes are only to the object structure in memory, and one must call the <B>write_aclB> method, or the <B>write_prettyB> method to commit them.

Example:



  $acl->add_resource(/,
    rick    =>  rw,
    steve   =>  rw,
    gibb    =>  r,
  );



<B>remove_resourceB> removes a resource from the current acl object structure. as with <B>add_resourceB> these changes are only to the object structure in memory, and must be commited with a write_ method.

Example:



  $acl->remove_resource(/);



<B>resourcesB> returns an array of resource objects, takes no arguments.

Example:



  for($acl->resources) {
      print $_->name . "\n";
  }



<B>resourceB> resolves a resource name to its <B>SVN::Access::ResourceB> object.

Example:



  my $resource = $acl->resource(/);



<B>add_groupB> adds a group to the current acl object structure. these changes are only to the object structure in memory, and must be written out with <B>write_aclB> or <B>write_prettyB>.

Example:



  $acl->add_group(stooges, larry, curly, moe, shemp);



<B>remove_groupB> removes a group from the current acl object structure. these changes are only to the object structure in memory, and must be written out with <B>write_aclB> or <B>write_prettyB>.

Example:



  $acl->remove_group(stooges);



<B>groupsB> returns an array of group objects, takes no arguments.

Example:



  for($acl->groups) {
      print $_->name . "\n";
  }



<B>groupB> resolves a group name to its <B>SVN::Access::GroupB> object.

Example:



  $acl->group(pants_wearers)->add_member(ralph);



<B>write_aclB> takes no arguments, writes out the current acl object structure to the acl_file specified in the constructor.

Example:



  $acl->write_acl;



<B>write_prettyB> the same as write_acl, but does it with extra whitespace to line things up.

Example:



  $acl->write_pretty;



<B>verify_aclB> does a pre-flight check of the acl, and returns any errors found delimited by new lines. this routine is called by write_acl and write_pretty, where these errors will be considered fatal. be sure to either call this before $acl->write_*, OR use eval { } to capture the return of verify_acl into $@.

Example:



  if (my $error = $acl->verify_acl) {
    print "Problem found in your ACL: $error\n";
  } else {
    $acl->write_acl;
  }



<B>add_aliasB> adds an alias to [aliases], takes 2 arguments: the alias name and the aliased user.

Example:
$acl->add_alias(’mikey’, ’uid=mgregorowicz,ou=people,dc=mg2,dc=org’);

<B>remove_aliasB> removes an alias by name, takes the alias name as an argument.

Example:
$acl->remove_alias(’mikey’);

<B>aliasB> returns the value of an alias, uses exists() first so it will not autovivify the key in the hash.

Example:
print $acl->alias(’mikey’) . \n;

<B>aliasesB> returns a hashref that contains the aliases. editing this hashref will edit the data inside the $acl object.

Example:
foreach my $alias (keys %{$acl->aliases}) {
print $alias: . $acl->aliases->{$alias} . \n;
}

<B>resolveB> Returns a fully resolved list of users part of the given groups and/or aliases. Groups must be specified with a leading @ and aliases with a leading &, all else will be returned verbatim. This recurses through all definitions to get actual user names (so groups within groups will be handled properly).

SEE ALSO

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

AUTHOR

Michael Gregorowicz, <mike@mg2.org>

COPYRIGHT AND LICENSE

Copyright (C) 2012 by Michael Gregorowicz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SVN::ACCESS (3) 2015-05-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.