Commit 0335daca authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#639] set default grants if user has none

parent 3227926a
......@@ -161,6 +161,7 @@ sub _update_user_grants {
my $user = Ravada::Auth::SQL->search_by_id($id);
next if $user->name() eq $USER_DAEMON_NAME;
next if $user->grants();
$USER_DAEMON->grant_user_permissions($user);
$USER_DAEMON->grant_admin_permissions($user) if $user->is_admin;
}
......
......@@ -736,6 +736,12 @@ sub can_change_settings($self, $id_domain=undef) {
return 0;
}
sub grants($self) {
$self->_load_grants() if !$self->{_grant};
return () if !$self->{_grant};
return %{$self->{_grant}};
}
sub AUTOLOAD($self) {
my $name = $AUTOLOAD;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment