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


App-Context documentation  | view source Contained in the App-Context distribution.

Index


NAME

Top

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

SYNOPSIS

Top

    use App;

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

DESCRIPTION

Top

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

Top

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

* Class: App::Authorization
* Class: App::Authorization::SharedDatastore

Class: App::Authorization

Top

An Authorization service ...

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

Class Design

...

Constructor Methods:

Top

new()

The constructor is inherited from App::Service|App::Service/"new()".

Public Methods:

Top

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:

Top

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

Top

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

SEE ALSO

Top

App::Context|App::Context, App::Service|App::Service


App-Context documentation  | view source Contained in the App-Context distribution.