NAME

OpusVL::AppKit::Plugin::AppKit

VERSION

version 2.28

DESCRIPTION

People not developing the actual AppKit should not really need to know much about this plugin.

It is used by the OpusVL::AppKit which intended to be inherited by another Catalyst App using 
CatalystX::AppBuilder..

NAME

OpusVL::AppKit::Plugin::AppKit - Common functions to get OpusVL::AppKit working.

METHODS

apps_allowed

Returns a list of the appkit controllers the user has access to sorted as the app config specifies. Generally used for building up the menu.

List of apps and the group data for the full blown menu

[
    {
        'controller' => bless( {
                'appkit_method_group' => 'Leads',
                'appkit_name' => 'Customers',
                }, 'Aquarius::Controller::Leads' ),
            'actions' => [
            {
                'actions' => [
                    {
                        'controller' => $controller,
                        'actionname' => 'index',
                        'value' => 'PO Approvers',
                        'sort_index' => 1,
                        'actionpath' => 'accounts/auth/index'
                    },
                    {
                        'controller' => $controller,
                        'actionname' => 'index',
                        'value' => 'Next Item',
                        'sort_index' => 1,
                        'actionpath' => 'accounts/auth/index'
                    },
                    $VAR1->[4]{'controller'}{'navigation_actions'}[3],
                    $VAR1->[4]{'controller'}{'navigation_actions'}[5],
                    $VAR1->[4]{'controller'}{'navigation_actions'}[4]
                ],
                'group' => 'Leads'
            },
            {
                'actions' => [
                    $VAR1->[4]{'controller'}{'navigation_actions'}[0],
                    $VAR1->[4]{'controller'}{'navigation_actions'}[2],
                    $VAR1->[4]{'controller'}{'navigation_actions'}[1]
                ],
                'group' => 'Customers'
            }
        ]
    }
];

appkit_actiontree_visitor Use for find node in the appkit_actiontree...

is_unrestricted_action_name Little helper to ascertain if an action's name is one we dont apply access control to.

execute The method hooks into the catalyst despatch path. If the current logged in used is denied access to the action this will detach to the 'access_denied' action.

appkit_features

Returns a OpusVL::AppKit::Plugin::AppKit::FeatureList object that allows the querying of the features permissions that sit on top of our roles management.

appkit_actiontree This returns a Tree::Simple of OpusVL::AppKit::Plugin::AppKit::Node's. Based on code from Catalyst::Plugin::Authorization::ACL::Engine, it is basically a Tree of this apps actions. This attribute is used to define access to actions.(but could be used for many more things)

Arguments:
    $_[0]   -   Self
    $_[1]   -   Optional flag to say "re-read the tree"

_build_appkit_actiontree internal only method that supports the appkit_actiontree routine. This basically builds a tree of actions/controllers in the current catalyst app.

can_access Checks the ACL structure against the current user and action. return 1 or 0 depending on if the user can access the action_path

Used like so:
    if ( $c->can_access( 'controller/action/path' ) )
    {
        # $c->user must have the correct roles.
    }

THIS NEEDS A MASSIVE CLEAN UP ONCE WE ARE HAPPY APPKIT WORKS WELL.

who_can_access Checks the ACL structure to see who can access a passed action_path. Returns: undef - if not allowed roles resultset - of users that can access the otherwise returns a resultset

_find_node_in_appkit_actiontree Returns OpusVL::AppKit::Plugin::AppKit::Node that represents the action_path. .. or undef if not found.

_allowed_roles_from_tree Returns ArrayRef of roles that can access the passed action path. This checks the 'appkit_actiontree' .. so should be quick.

_allowed_roles_from_db Returns ArrayRef of roles that can access the passed action path. This checks the database (model)

_appkit_stash_portlets Put all the AppKit Controller Portlets data in the stash If you forward to this action, you should end up with a stash value keyed by 'portlets'. eg. $c->forward('stash_portlets'); The value of 'portlets' is an ArrayRef of HashRefs. The HashRefs contain 2 keys: name = The name of the portlet html = The HTML content of the portlet

_appkit_stash_navigation Put all the AppKit Controller Navigation data in the stash If you forward to this action, you should end up with a stash value keyed by 'navigation'. eg. $c->forward('stash_navigation'); The value of 'navigation' is an ArrayRef of HashRefs. The HashRefs contain 2 keys: text = The text of the navigation item uri = The uri if the action the navigation relates to.

generate_class_name

A simple utility function to turn a string into a css class by removing whitespace and non word characters, then lower casing it.

This should provide a way to get predictable and legitimate css class names from data.

AUTHOR

OpusVL - www.opusvl.com

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by OpusVL - www.opusvl.com.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.