CallBackery::User - tell me about the current user
use CallBackery::User; my $user = CallBackery::User->new($self->controller); $user->werk; $user->may('right'); # does the user have the given right $user->id;
All the methods if Mojo::Base as well as the following
the controller
By default the userId is numeric and represents a user account. For system tasks, it gets set to alphabetic identifiers. The following alphabetic identifiers do exist:
__CONSOLE when running in the config console mode __CONFIG for backup and restore tasks
return the user id if the session user is valid.
a handle to a CallBackery::Database object.
returns a pointer to one of the Database object of a Mojo::Pg instance.
returns a hash of information about the current user.
Extracts the session config from the cookie from the X-Session-Cookie header or the xsc parameter. If the xsc parameter is set, its timestamp must be no older than 2 seconds.
login the user object. If login return 1 you can then makeSessionCookie.
may
Check if the user has the right indicated.
Returns a timestamped, signed session cookie containing the current userId.
Copyright (c) 2013 by OETIKER+PARTNER AG. All rights reserved.
Tobi Oetiker <tobi@oetiker.ch>
2010-06-12 to 1.0 initial 2013-11-19 to 1.1 mojo port
To install CallBackery, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CallBackery
CPAN shell
perl -MCPAN -e shell install CallBackery
For more information on module installation, please visit the detailed CPAN module installation guide.