WWW::MenuGrinder::Plugin::RequirePrivilege - WWW::MenuGrinder plugin that does privilege checks on items.
version 0.06
WWW::MenuGrinder::Plugin::RequirePrivilege is a plugin for WWW::MenuGrinder. You should not use it directly, but include it in the plugins section of a WWW::MenuGrinder config.
WWW::MenuGrinder::Plugin::RequirePrivilege
WWW::MenuGrinder
plugins
When loaded, this plugin will remove any menu item containing one of the following keys, along with all of that item's children, if the current request's user doesn't meet a specific requirement:
need_user
The item will only be displayed if a user is logged in.
no_user
The item will only be displayed if a user is not logged in.
need_user_in_realm
The item will only be displayed if a user is logged into the realm identified by this key.
no_user_in_realm
The item will only be displayed if a user is not logged into the realm identified by this key.
need_priv
The item will only be displayed if the user possesses the privilege identified by this key.
no_priv
The item will only be displayed if the user does not possess the privilege identified by this key.
None.
In order to load this plugin your WWW::MenuGrinder subclass must implement the method has_priv, which receives a privilege name as a string and returns true or false indicating whether the privilege check was successful.
has_priv
Andrew Rodland <andrew@hbslabs.com>
This software is copyright (c) 2011 by HBS Labs, LLC..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WWW::MenuGrinder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::MenuGrinder
CPAN shell
perl -MCPAN -e shell install WWW::MenuGrinder
For more information on module installation, please visit the detailed CPAN module installation guide.