summaryrefslogtreecommitdiff
path: root/perl/lib/Wallet/ACL/Base.pm
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2016-01-17 19:43:13 -0800
committerRuss Allbery <eagle@eyrie.org>2016-01-17 19:43:13 -0800
commitcf5297c4ec8815ecc7f5139ef05b9867843db2f7 (patch)
treefef6ba149883530c7e7fba771be6ac2e59c4dfe9 /perl/lib/Wallet/ACL/Base.pm
parent7e03241ce323be7447b085a8e7b07b78c770b0dc (diff)
parent4b3f858ef567c0d12511e7fea2a56f08f2729635 (diff)
Merge tag 'upstream/1.3' into debian/master
Upstream version 1.3
Diffstat (limited to 'perl/lib/Wallet/ACL/Base.pm')
-rw-r--r--perl/lib/Wallet/ACL/Base.pm28
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 ...])