Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
02638600
Commit
02638600
authored
Jun 14, 2021
by
Roberto P. Rubio
Browse files
Not public machines can be copied
parent
ad0e2281
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/VM.pm
View file @
02638600
...
...
@@ -414,8 +414,9 @@ sub _around_create_domain {
||
$owner
->
can_create_machine
()
||
(
$base
&&
$owner
->
can_clone
);
confess
"
ERROR: Base
"
.
$base
->
name
.
"
is private
"
if
!
$owner
->
is_admin
&&
$base
&&
!
$base
->
is_public
();
# Do not check if base is public to allow not public machines to be copied
# confess "ERROR: Base ".$base->name." is private"
# if !$owner->is_admin && $base && !$base->is_public();
if
(
$add_to_pool
)
{
confess
"
Error: This machine can only be added to a pool if it is a clone
"
...
...
@@ -824,10 +825,12 @@ sub _check_require_base {
die
"
ERROR: Domain
"
.
$self
->
name
.
"
is not base
"
if
!
$base
->
is_base
();
my
$user
=
Ravada::Auth::
SQL
->
search_by_id
(
$id_owner
);
# Do not check if base is public to allow not public machines to be copied
# my $user = Ravada::Auth::SQL->search_by_id($id_owner);
die
"
ERROR: Base
"
.
$base
->
name
.
"
is not public
\n
"
unless
$user
->
is_admin
||
$base
->
is_public
;
#
die "ERROR: Base ".$base->name." is not public\n"
#
unless $user->is_admin || $base->is_public;
}
=head2 id
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment