Commit f4fac0fa authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#222] grant minimal permissions for old users

parent f8903f5e
......@@ -105,6 +105,18 @@ sub BUILD {
$self->_update_data();
}
sub _update_user_grants {
my $self = shift;
my $sth = $CONNECTOR->dbh->prepare("SELECT id FROM users");
my $id;
$sth->bind_columns(\$id);
$sth->execute;
while ($sth->fetch) {
my $user = Ravada::Auth::SQL->search_by_id($id);
}
$sth->finish;
}
sub _update_isos {
my $self = shift;
my $table = 'iso_images';
......@@ -161,6 +173,7 @@ sub _update_isos {
sub _update_data {
my $self = shift;
$self->_update_isos();
$self->_update_user_grants();
}
sub _upgrade_table {
......
......@@ -390,8 +390,6 @@ sub _load_grants($self) {
$self->{_grant}->{$name} = ( $allowed or 0);
}
$sth->finish;
$self->grant_user_permissions($self);
}
sub grant_user_permissions($self,$user) {
......
......@@ -24,6 +24,7 @@ init($test->connector);
sub test_defaults {
my $user= create_user("foo","bar");
my $rvd_back = rvd_back();
ok($user->can_clone);
ok($user->can_change_settings);
......
Markdown is supported
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