diff options
author | Russ Allbery <rra@dropbox.com> | 2016-02-03 12:44:33 -0800 |
---|---|---|
committer | Russ Allbery <rra@dropbox.com> | 2016-02-03 12:44:33 -0800 |
commit | 2a53df4444cb8a931e82c584288025e315f40121 (patch) | |
tree | 7c8b9bfa69cf613a22ba6be616a0d3fdb4146e4e /perl/lib/Wallet/ACL/Base.pm | |
parent | 294d46a917b6aa3af305c3d50b8d83a1f3fb5694 (diff) | |
parent | e64d4e31146b87046916c377557f8ea789da3f0a (diff) |
Merge branch 'debian/master' into ubuntu/precise
Diffstat (limited to 'perl/lib/Wallet/ACL/Base.pm')
-rw-r--r-- | perl/lib/Wallet/ACL/Base.pm | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/perl/lib/Wallet/ACL/Base.pm b/perl/lib/Wallet/ACL/Base.pm index a2b07cc..235a9cb 100644 --- a/perl/lib/Wallet/ACL/Base.pm +++ b/perl/lib/Wallet/ACL/Base.pm @@ -1,6 +1,7 @@ -# Wallet::ACL::Base -- Parent class for wallet ACL verifiers. +# Wallet::ACL::Base -- Parent class for wallet ACL verifiers # # Written by Russ Allbery <eagle@eyrie.org> +# Copyright 2016 Russ Allbery <eagle@eyrie.org> # Copyright 2007, 2010, 2014 # The Board of Trustees of the Leland Stanford Junior University # @@ -11,16 +12,12 @@ ############################################################################## package Wallet::ACL::Base; -require 5.006; +use 5.008; use strict; use warnings; -use vars qw($VERSION); -# This version should be increased on any code change to this module. Always -# use two digits for the minor version with a leading zero if necessary so -# that it will sort properly. -$VERSION = '0.02'; +our $VERSION = '1.03'; ############################################################################## # Interface @@ -37,6 +34,11 @@ sub new { return $self; } +# The default name check method allows any name. +sub syntax_check { + return 1; +} + # The default check method denies all access. sub check { return 0; @@ -92,10 +94,18 @@ inherit from it. It is not used directly. Creates a new ACL verifier. The generic function provided here just creates and blesses an object. -=item check(PRINCIPAL, ACL) +=item syntax_check(PRINCIPAL, ACL) + +This method should be overridden by any child classes that want to +implement validating the name of an ACL before creation. The default +implementation allows any name for an ACL. + +=item check(PRINCIPAL, ACL, TYPE, NAME) This method should always be overridden by child classes. The default -implementation just declines all access. +implementation just declines all access. TYPE and NAME are the type and +name of the object being accessed, which may be used by some ACL schemes +or may be ignored. =item error([ERROR ...]) |