fix: remove useless warning when there is no guest access

This commit is contained in:
Stéphane Lesimple 2020-12-23 10:23:55 +00:00
parent 2d79b7a1ba
commit 8c31ea277c
No known key found for this signature in database
GPG key ID: 4B4A3289E9D35658

View file

@ -167,7 +167,7 @@ sub act {
# if the user is a guest, must remove all his guest accesses first
$fnret = OVH::Bastion::get_acl_way(way => 'groupguest', group => $shortGroup, account => $account);
if ($fnret && $fnret->value) {
if ($fnret && $fnret->value && @{$fnret->value}) {
osh_warn("This account was previously a guest of this group, with the following accesses:");
my @acl = @{$fnret->value};
OVH::Bastion::print_acls(acls => [{type => 'group-guest', group => $shortGroup, acl => \@acl}]);