Ravada::Auth::SQL(3)
β¨ NAME β¨
Ravada::Auth::SQL β the SQL authentication library for Ravada, bestie π
Like, this is the whole entire bouncer of Ravada. Users, passwords, permissions, groups, LDAP crossover, all of it. It's giving main character energy for auth. Let's go through every single method, no skips, no cap. π
π οΈ BUILD
Internal OO build method. That's it, that's the whole vibe β it's the plumbing behind the scenes, you don't call it, it calls itself. iykyk π
π search_by_id
Searches a user by its id. Your little lookup bestie.
my $user = Ravada::Auth::SQL->search_by_id( $id );
π list_all_users
Returns a list of all the usernames. Everyone. The whole group chat. π
β add_user
Adds a new user in the SQL database. Returns nothing β like, it does the thing and dips, no receipt. π«Ά
Ravada::Auth::SQL::add_user(
name => $user
, password => $pass
, is_admin => 0
, is_temporary => 0
);
π login
Logins the user. Two ways to do it, pick your fighter:
my $ok = $user->login($password);
my $ok = Ravada::LDAP::SQL::login($name, $password);
Returns true if it succeeds. Slay. β¨
π make_admin
Makes the user admin. Returns nothing. Congrats on the promotion, no take-backsies, just vibes.
Ravada::Auth::SQL::make_admin($id);
π remove_admin
Remove user admin privileges. Returns nothing. The crown has been returned to the vault, bestie. π
Ravada::Auth::SQL::remove_admin($id);
π external_auth
Sets or gets the external auth value of an user. It's giving double duty β setter and getter, versatile icon. π¦
π¦Έ is_admin
Returns true if the user is admin.
my $is = $user->is_admin;
ποΈ is_user_manager
Returns true if the user is user manager. Manager girlies rise π
π§° is_operator
Returns true if the user is admin or has been granted special permissions. Two paths, same slay.
π» can_list_own_machines
Returns true if the user can list her own virtual machines at the web frontend (can_XXXXX).
𧬠can_list_clones_from_own_base
Returns true if the user can list all machines that are clones from his bases (can_XXXXX_clones).
π can_list_clones
Returns true if the user can list all machines that are clones and its bases (can_XXXXX_clones_all).
π₯οΈ can_list_machines
Returns true if the user can list all the virtual machines at the web frontend (can_XXXXX_all or is_admin).
π is_external
Returns true if the user authentication is not from SQL. Outsourced auth, but make it iconic.
my $is = $user->is_external;
β³ is_temporary
Returns true if the user is admin.
Not me noticing the doc says "admin" here and not "temporary" π β we're just the messenger, this is exactly what the original says, fr fr.
my $is = $user->is_temporary;
π id
Returns the user id. Your literal government name, but numbers.
my $id = $user->id;
π password_will_be_changed
Returns true if user password will be changed. A lil heads-up notification, basically.
$user->password_will_be_changed();
π change_password
Changes the password of an User.
$user->change_password();
Arguments: password
π§ͺ compare_password
Changes the input with the password of an User.
$user->compare_password();
Arguments: password
π£οΈ language
Updates or selects the language selected for an User.
$user->language();
Arguments: lang
π§Ή remove
Removes the user. Poof. Gone. Unfollowed, blocked, deleted. π
$user->remove();
β can_do
Returns if the user is allowed to perform a privileged action.
if ($user->can_do("remove")) {
...
π₯οΈ can_do_domain
Returns if the user is allowed to perform a privileged action in a virtual machine.
if ($user->can_do_domain("remove", $domain)) {
...
π grant_user_permissions
Grant an user permissions for normal users.
π§ grant_operator_permissions
Grant an user operator permissions, ie: hibernate all.
π§βπΌ grant_manager_permissions
Grant an user manager permissions, ie: hibernate all clones.
π grant_admin_permissions
Grant an user all the permissions. Full send. π
π« revoke_all_permissions
Revoke all permissions from an user. Everything. Back to zero, bestie.
ποΈ grant
Grant an user a specific permission, or revoke it.
$admin_user->grant($user2,"clone"); # both are
$admin_user->grant($user3,"clone",1); # the same
$admin_user->grant($user4,"clone",0); # revoke a grant
βοΈ revoke
Revoke a permission from an user.
$admin_user->revoke($user2,"clone");
π list_all_permissions
Returns a list of all the available permissions.
π·οΈ grant_type
Returns the type of a grant type, currently it can be 'boolaean' or 'int'.
Yes, 'boolaean'. That's the spelling in the original. We are not fixing it, we are respecting it. π
π list_permissions
Returns a list of all the permissions granted to the user.
sub can_change_settings($self, $id_domain=undef) {
if (!defined $id_domain) {
return $self->can_do("change_settings");
}
return 1 if $self->can_change_settings_all();
return 0 if !$self->can_change_settings();
my $domain = Ravada::Front::Domain->open($id_domain);
return 1 if $self->id == $domain->id_owner;
return 0;
}
βοΈ can_manage_machine
The user can change settings, remove or change other things yet to be defined. Some changes require special permissions granted.
Unlinke change_settings that any user is granted to his own machines by default.
That typo is in the original too, and honestly? It's a whole mood. Keeping it. π
ποΈ can_remove_clones
Returns true if the user can remove clones.
Arguments:
- id_domain: optional
β can_remove_machine
Return true if the user can remove this machine.
Arguments:
- domain
π can_shutdown_machine
Return true if the user can shutdown this machine.
Arguments:
- domain
βΆοΈ can_start_machine
Return true if the user can shutdown this machine.
Arguments:
- domain
π¦ grants
Returns a list of permissions granted to the user in a hash.
ποΈ grants_info
Returns a list of the permissions granted to an user as a hash. Each entry is a reference to a list where the first value is the grant and the second the type.
π ldap_entry
Returns the ldap entry as a Net::LDAP::Entry of the user if it has LDAP external authentication.
π― groups
Returns a list of the groups this user belogs to.
Another original spelling, we're keeping that too, no edits no regrets π«Ά
π groups_local
Returns a list of the local groups this user belogs to.
πΎ disk_used
Returns the amount of disk space used by this user in MB.
π« add_to_group
Adds the user to a group or list of groups.
Arguments: list of group names
πͺ remove_from_group
Removes the user from a group or list of groups.
Arguments: list of group names
π can_change_hardware_network
Returns true if the user can change the network in a virtual machine, false elsewhere.
ποΈ can_view_admin_machines
Returns true if the user can acess admin machines menu.
"acess" β yes, also original. We stan consistency in the source material. π
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
Around line 1215:
=pod directives shouldn't be over one line long! Ignoring all 6
lines of content
okay so that's literally the entire page, every method, every arg, every typo preserved, no cap π This one came from the perl v5.42.0 era, dated 2025-09-20, and it's filed under Ravada::Auth::SQL(3) in the User Contributed Perl Documentation corner of the man pages. Go be an admin about it, bestie. periodt. πβ¨π
π¦ where this page comes from
- fedora 43: ravada 2.4.1-1.fc43 Β· AGPL-3.0-only AND Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms