Fudge supported_features in Htpasswd::User, and fix handling in the base class
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Plugin / Authentication / User.pm
index 7c33c98..9fb90eb 100644 (file)
@@ -9,7 +9,21 @@ sub id { die "virtual" }
 
 sub store { die "virtual" }
 
-sub supports { die "virtual" }
+sub supports {
+    my ( $self, @spec ) = @_;
+
+    my $cursor = $self->supported_features;
+
+    # traverse the feature list,
+    for (@spec) {
+        #die "bad feature spec: @spec" if ref($cursor) ne "HASH";
+        return if ref($cursor) ne "HASH";
+
+        $cursor = $cursor->{$_};
+    }
+
+    return $cursor;
+}
 
 __PACKAGE__;