The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Authorization - A service that is used by various application components to know what the current user is authorized to do

SYNOPSIS

    use App;

    $context = App->context();
    $auth = $context->service("Authorization");  # or ...
    $auth = $context->authorization();

DESCRIPTION

An Authorization service is a means by which by various application components to know what the current user is authorized to do.

Class Group: Authorization

The following classes might be a part of the Authorization Class Group.

  • Class: App::Authorization

  • Class: App::Authorization::SharedDatastore

Class: App::Authorization

An Authorization service ...

 * Throws: App::Exception::Authorization
 * Since:  0.01

Class Design

...

Constructor Methods:

new()

The constructor is inherited from App::Service.

Public Methods:

is_authorized()

    * Signature: $auth->is_authorized($key);
    * Signature: $auth->is_authorized($key, $user);
    * Signature: $auth->is_authorized($key, $user, $options);
    * Signature: $auth->is_authorized($key, undef, $options);
    * Param:     $key               string
    * Param:     $user              string
    * Param:     $options           HASH
    * Return:    $is_auth           boolean
    * Throws:    App::Exception::Authorization
    * Since:     0.01

    Sample Usage: 

    $context = App->context();
    $auth = $context->service("Authorization");  # or ...
    $auth = $context->authorization();
    if ($auth->is_authorized("/main/data/edit")) {
        # ...
    }

Protected Methods:

service_type()

Returns 'Authorization';

    * Signature: $service_type = App::Authorization->service_type();
    * Param:     void
    * Return:    $service_type  string
    * Since:     0.01

    $service_type = $auth->service_type();

ACKNOWLEDGEMENTS

 * Author:  Stephen Adkins <spadkins@gmail.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.

SEE ALSO

App::Context, App::Service