Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: share machine #2021

Merged
merged 15 commits into from
Feb 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip: deny remove base
frankiejol committed Jan 22, 2024
commit b872693606826d69bac4b820c4ac2ac85e29ec27
7 changes: 6 additions & 1 deletion lib/Ravada.pm
Original file line number Diff line number Diff line change
@@ -4978,9 +4978,14 @@ sub _cmd_remove_base {
my $user = Ravada::Auth::SQL->search_by_id( $uid);

my $domain = $self->search_domain_by_id($id_domain);

die "Unknown domain id '$id_domain'\n" if !$domain;

die "User ".$user->name." [".$user->id."] not allowed to remove base "
.$domain->name."\n"
unless $user->is_admin || (
$domain->id_owner == $user->id && $user->can_create_base());


$domain->remove_base($user);

}
4 changes: 2 additions & 2 deletions t/user/20_grants.t
Original file line number Diff line number Diff line change
@@ -957,11 +957,11 @@ sub test_view_all($vm) {
wait_request( check_error => 0, debug => 0);
for my $req ($req_prepare, $req_remove_base, $req_shutdown) {
is($req->status,'done');
like($req->error,qr'User.* (can.t |not allowed)', $req->command);
like($req->error,qr'User.* (can.t |not allowed)', $req->command)
or exit;
}
for my $req ( $req_start_admin, $req_prepare_admin, $req_start
,$req_refresh, $req_refresh_ports) {
diag($req->command);
is($req->status,'done');
next if $req->command =~ /refresh_machine_ports/i;
is($req->error,'', $req->command) or exit;