Pangloss::User::Privileges - user privileges.
use Pangloss::User::Privileges; my $privs = new Pangloss::User::Privileges(); $privs->admin( false ) ->add_concepts( true ) ->add_categories( true ) ->add_translate_languages( @languages ) ->add_proofread_languages( @languages ); do { ... } if $privs->can_translate( $language ); do { ... } if $privs->can_proofread( $language ); do { ... } if $privs->admin(); # etc.
This class represents the privileges of a user in Pangloss. A user with special privileges can do one or more of:
translate terms in a given language proofread terms in a given language add concepts add categories administrate Pangloss
New privileges are created with an empty list of translate/proofread languages.
This class inherits from Pangloss::StoredObject.
set/get 'add concepts' flag of the user.
set/get 'add categories' flag of the user.
set/get administration flag of the user.
set/get hash of Pangloss::Language keys the user is allowed to translate.
set/get hash of Pangloss::Language keys the user is allowed to proofread.
test to see if user can translate/proofread one or more <Pangloss::Language>s.
add to the relevant list of languages. accepts Pangloss::Languages or their keys. returns this object.
remove from the relevant list of languages. accepts Pangloss::Languages or their keys. returns this object.
test to see if user can translate/proofread given Pangloss::Language.
Steve Purkis <spurkis@quiup.com>
Pangloss::User, Pangloss::Language
To install Pangloss, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pangloss
CPAN shell
perl -MCPAN -e shell install Pangloss
For more information on module installation, please visit the detailed CPAN module installation guide.