NAME
WWW::Suffit::AuthDB::User - WWW::Suffit::AuthDB user class
SYNOPSIS
use WWW::Suffit::AuthDB::User;
DESCRIPTION
This module provides AuthDB user methods
allow_ext
say "yes" if $user->allow_ext;
Returns true if user has access to external routes
allow_int
say "yes" if $user->allow_int;
Returns true if user has access to internal routes
forever
say "yes" if $user->forever;
Returns true if user can use endless API tokens
is_admin
say "yes" if $user->is_admin;
If user is admin then returns true
is_enabled
say "yes" if $user->is_enabled;
Returns status of user - enabled (true) or disabled (false)
is_valid
Check the user object
mark
Marks object as cached
to_hash
my $short = $user->to_hash();
my $full = $user->to_hash(1);
Returns user data as hash in short or full view
use_flags
say "yes" if $user->use_flags;
This method returns a binary indicator - whether flags should be used or not
ATTRIBUTES
- disabled
-
$user->disabled( 1 ); my $disabled = $user->disabled;
Sets and returns boolean ban-status of the user
Since 1.01 this method is deprecated! See is_enabled
-
$user->email('alice@example.com'); my $email = $user->email;
Sets and returns email address of user
- groups
-
$user->groups([qw/ administrator wheel /]); my $groups = $user->groups; # ['administrator', 'wheel']
Sets and returns groups of user (array of groups)
- is_valid
-
$user->is_valid or die "Incorrect user";
Returns boolean status of user's data
- name
-
$user->name('Mark Miller'); my $name = $user->name;
Sets and returns full name of user
- password
-
$user->password(sha256_hex('MyNewPassphrase')); my $password = $user->password;
Sets and returns password (hex sha256 digest) of user
- role
-
$user->role('Regular user'); my $role = $user->role;
Sets and returns role of user
- username
-
$user->username('new_username'); my $username = $user->username;
Sets and returns username
HISTORY
See Changes
file
TO DO
See TODO
file
SEE ALSO
WWW::Suffit::AuthDB, Mojolicious
AUTHOR
Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>
COPYRIGHT
Copyright (C) 1998-2023 D&D Corporation. All Rights Reserved
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See LICENSE
file and https://dev.perl.org/licenses/