CGI::A...:Driver(3pm)
π CGI::Application::Plugin::Authorization::Driver π
okay bestie, welcome to the base module for building driver classes for CGI::Application::Plugin::Authorization β¨ it's the blueprint, the vibe template, the "here's how you plug your own auth logic in" situation. slay.
β¨ SYNOPSIS β¨
package CGI::Application::Plugin::Authorization::Driver::MyDriver;
use base qw(CGI::Application::Plugin::Authorization::Driver);
sub authorize_user {
my $self = shift;
my @params = @_;
if ( >>> Valid Access Permissions <<< ) {
return 1;
}
return;
}
like. that's it. that's the whole vibe π«Ά
πΈ DESCRIPTION πΈ
so this module is the base class for every driver class that works with the CGI::Application::Plugin::Authorization plugin. every driver class has exactly one job: provide a single method that authorizes the params you hand it. most of the time those params are a list of groups the user needs to be in, but ngl it could be literally anything. no cap. π
π METHODS π
new
the constructor, bestie β¨ it builds you a fresh Driver object. it needs an Authorization object as its first parameter, plus however many other params you want β those get used as options, and which ones matter depends on which Driver object you're actually creating. but honestly? you probably shouldn't be calling this yourself, because the Authorization plugin handles making Driver objects for you. let it cook. π
initialize
this one gets called right after a new Driver object is created. so if you've got startup customizations, this is your moment. main character energy fr fr. π
options
returns a list of the options that were provided when this driver got configured by the user. that's it. that's the whole method. iconic. β
find_option
searches the Driver options for a specific key and gives you back the value it finds. heads up tho: this method assumes the Driver configuration holds a hash of information. if it doesn't? you're on your own and you'll have to parse the option manually in the subclass. sorry bestie π
authz
returns the underlying CGI::Application::Plugin::Authorization object. in most cases you won't need to touch this at all. it's giving "for emergencies only". π
username
returns the name of the current logged-in user by calling the username method documented over in CGI::Application::Plugin::Authorization. lowkey convenient. π
authorize
# User must be in the admin group to have access to this runmode
return $self->authz->forbidden unless $self->authz->authorize('admin');
this verifies that the currently logged-in user (found via username) passes the authorization checks based on whatever params you gave it β usually a list of groups. vibe check on the user, basically. π
authorize_user
okay this one is the one you actually have to write in your driver class. it needs to be an object method that accepts a username, followed by a list of parameters, and then verifies the user passes the authorization checks based on those parameters. if the checks succeed, return a true value. periodt. π
π¦ SEE ALSO π¦
CGI::Application::Plugin::Authorizationperl(1)
π AUTHOR π
Cees Hek <ceeshek@gmail.com>
πΈ LICENCE AND COPYRIGHT πΈ
Copyright (c) 2005, SiteSuite. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π DISCLAIMER OF WARRANTY π
okay so this part is ALL CAPS for a reason and I am not softening it, bestie. read it, it matters.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
perl v5.30.3 π«Ά 2020-09-25 β that's the version and date this lil page came from, bestie. go forth and authorize responsibly. mwah πβ¨π
π¦ where this page comes from
- debian bookworm: libcgi-application-plugin-authorization-perl 0.07+~cs0.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-plugin-authorization-perl 0.07+~cs0.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcgi-application-plugin-authorization-perl 0.07+~cs0.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-plugin-authorization-perl 0.07+~cs0.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-authorization-perl 0.07+~cs0.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-authorization-perl 0.07+~cs0.1-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms