Commit bf422e47 authored by Kimia Mirehbar's avatar Kimia Mirehbar Committed by Francesc Guasch
Browse files

modification of shutdown+hibernate grant

parent a1379be6
......@@ -328,12 +328,13 @@ get '/machine/clone/(:id).(:type)' => sub {
get '/machine/shutdown/(:id).(:type)' => sub {
my $c = shift;
return access_denied($c) if !$USER ->can_shutdown_clone();
return access_denied($c) if !$USER ->can_shutdown_all();
return shutdown_machine($c);
};
get '/machine/shutdown/(:id).(:type)' => sub {
my $c = shift;
return access_denied($c) if !$USER ->can_shutdown_all();
return shutdown_machine($c);
};
......@@ -377,6 +378,7 @@ get '/machine/pause/(:id).(:type)' => sub {
get '/machine/hybernate/(:id).(:type)' => sub {
my $c = shift;
return access_denied($c) if !$USER ->can_hibernate_all();
return hybernate_machine($c);
};
......
......@@ -108,13 +108,15 @@
<i class="fa fa-play"></i>
</a>
% }
% if ($_user-> can_hibernate_all){
<a type="button" class="btn btn-warning btn-sm"
ng-click="action('machine','hybernate',machine.id)"
ng-disabled="!machine.is_active"
title="<%=l 'Hybernate' %>">
<i class="fa fa-pause"></i>
</a>
% if ($_user->can_shutdown_clone){
% }
% if ($_user->can_shutdown_all){
<a type="button" class="btn btn-danger btn-sm"
ng-click="action('machine','shutdown',machine.id)"
ng-disabled="!machine.is_active"
......
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