Skip Menu |

This queue is for tickets about the CGI-Application-Plugin-Authorization CPAN distribution.

Report information
The Basics
Id: 17479
Status: resolved
Priority: 0/
Queue: CGI-Application-Plugin-Authorization

People
Owner: Nobody in particular
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: PATCH: new Simpe driver
Attached is a new "Simple" driver, which requires no configuration yet is still useful! Mark
Subject: Simple.pm
package CGI::Application::Plugin::Authorization::Driver::Simple; use strict; use warnings; use base qw(CGI::Application::Plugin::Authorization::Driver); =head1 NAME CGI::Application::Plugin::Authorization::Driver::Simple - Simple Authorization driver =head1 SYNOPSIS use base qw(CGI::Application); use CGI::Application::Plugin::Authorization; __PACKAGE__->authz->config( DRIVER => [ 'Simple' ], # You are responsible for setting a group param somehow! GET_USERNAME => sub { my $authz = shift; return $authz->cgiapp->session->param('group') }, ); =head1 DESCRIPTION This driver achieves simplicity by assuming that the C<username> method of L<CGI::Application::Plugin::Authorization> will return a group rather than a username. Thus it can be directly compared with the list of authorized groups passed to L<authorize> =head1 METHODS =head2 authorize_user I<This method is not intended to be used directly. Just follow the SYNOPSIS>. This method accepts a username followed by a list of group names and will return true if the user belongs to at least one of the groups. =cut sub authorize_user { my $self = shift; my $username = shift; my @groups = @_; foreach my $group (@groups) { return 1 if ($username eq $group); } return 0; } =head1 SEE ALSO L<CGI::Application::Plugin::Authorization::Driver>, L<CGI::Application::Plugin::Authorization>, perl(1) =head1 LICENCE AND COPYRIGHT Copyright (c) 2006, Mark Stosberg. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1;
Subject: SimpleGroup missing from 0.04
From: markstos [...] cpan.org
Cees, Thanks for intending to include the SimpleGroup driver in the 0.04 release. However, it didn't actually appear in the release. Perhaps you forgot to update the MANIFEST? Unrelated, here's a simple formatting patch for the DBI driver. It escapes the ">" character in the POD. Mark --- CGI-Application-Plugin-Authorization-0.04/lib/CGI/Application/Plugin/Authorization/Driver/DBI.pm Tue May 30 13:31:14 2006 +++ CGI-Application-Plugin-Authorization-0.04/lib/CGI/Application/Plugin/Authorization/Driver/DBI.pm.orig Wed Mar 29 21:02:04 2006 @@ -40,7 +40,7 @@ =head2 DBH -The DBI database handle to use. Defaults to C<$self-E<gt>dbh()>, which is provided and configured +The DBI database handle to use. Defaults to C<$self->dbh()>, which is provided and configured through L<CGI::Application::Plugin::DBH|CGI::Application::Plugin::DBH> When describing the database structure you have two options: shell returned 1