mirror of
https://github.com/ovh/the-bastion.git
synced 2024-12-26 01:26:10 +08:00
fix: groupInfo: don't attempt to (and fail) display the guest list when account doesn't have access to it
This commit is contained in:
parent
a20a3b8a5d
commit
92d8b421c2
1 changed files with 8 additions and 7 deletions
|
@ -253,14 +253,15 @@ sub print_group_info {
|
|||
if $ret{'members'};
|
||||
|
||||
# show guest info, along with the number of accesses each guest has
|
||||
my @guest_text;
|
||||
foreach my $guest (@{$ret{'guests'}}) {
|
||||
my $nb = $ret{'guests_accesses'}{$guest};
|
||||
push @guest_text, sprintf("%s[%s]", $guest, $nb // '?');
|
||||
if ($ret{'guests'}) {
|
||||
my @guest_text;
|
||||
foreach my $guest (@{$ret{'guests'}}) {
|
||||
my $nb = $ret{'guests_accesses'}{$guest};
|
||||
push @guest_text, sprintf("%s[%s]", $guest, $nb // '?');
|
||||
}
|
||||
osh_info("Group ${groupName}'s Guests (with access to SOME of the group servers) are: "
|
||||
. colored(@{$ret{'guests'}} ? join(" ", sort @guest_text) : '-', 'red'));
|
||||
}
|
||||
osh_info("Group ${groupName}'s Guests (with access to SOME of the group servers) are: "
|
||||
. colored(@{$ret{'guests'}} ? join(" ", sort @guest_text) : '-', 'red'))
|
||||
if $ret{'guests'};
|
||||
|
||||
# current user doesn't have enough rights to get this info, tell them that
|
||||
if (!$ret{'members'}) {
|
||||
|
|
Loading…
Reference in a new issue