| App-Context documentation | Contained in the App-Context distribution. |
App::Authorization - A service that is used by various application components to know what the current user is authorized to do
use App;
$context = App->context();
$auth = $context->service("Authorization"); # or ...
$auth = $context->authorization();
An Authorization service is a means by which by various application components to know what the current user is authorized to do.
The following classes might be a part of the Authorization Class Group.
An Authorization service ...
* Throws: App::Exception::Authorization * Since: 0.01
...
The constructor is inherited from
App::Service|App::Service/"new()".
Returns 'Authorization';
* Signature: $service_type = App::Authorization->service_type();
* Param: void
* Return: $service_type string
* Since: 0.01
$service_type = $auth->service_type();
* Author: Stephen Adkins <spadkins@gmail.com> * License: This is free software. It is licensed under the same terms as Perl itself.
App::Context|App::Context,
App::Service|App::Service
| App-Context documentation | Contained in the App-Context distribution. |
############################################################################# ## $Id: Authorization.pm 6783 2006-08-11 17:43:28Z spadkins $ ############################################################################# package App::Authorization; $VERSION = (q$Revision: 6783 $ =~ /(\d[\d\.]*)/)[0]; # VERSION numbers generated by svn use App; use App::Service; @ISA = ( "App::Service" ); use strict;
############################################################################# # CLASS GROUP #############################################################################
############################################################################# # CLASS #############################################################################
############################################################################# # CONSTRUCTOR METHODS #############################################################################
############################################################################# # new() #############################################################################
############################################################################# # PUBLIC METHODS #############################################################################
############################################################################# # is_authorized() #############################################################################
sub is_authorized { &App::sub_entry if ($App::trace); my ($self, $key, $user, $options) = @_; $user = $self->{context}->user() if (!$user); my $is_auth = 0; $is_auth = 1; &App::sub_exit($is_auth) if ($App::trace); return($is_auth); } ############################################################################# # PROTECTED METHODS #############################################################################
############################################################################# # Method: service_type() #############################################################################
sub service_type () { 'Authorization'; }
1;