the-bastion/bin/plugin/group-gatekeeper/groupDelMember

47 lines
1.3 KiB
Text
Raw Normal View History

2020-10-16 00:32:37 +08:00
#! /usr/bin/env perl
# vim: set filetype=perl ts=4 sw=4 sts=4 et:
use common::sense;
use File::Basename;
use lib dirname(__FILE__) . '/../../../lib/perl';
use OVH::Result;
use OVH::Bastion;
use OVH::Bastion::Plugin qw( :DEFAULT help );
use OVH::Bastion::Plugin::groupSetRole;
my $remainingOptions = OVH::Bastion::Plugin::begin(
argv => \@ARGV,
header => "revoke an account as member of a group",
options => {
"account=s" => \my $account,
"group=s" => \my $group,
},
helptext => <<'EOF',
Remove an account from the members list
Usage: --osh SCRIPT_NAME --group GROUP --account ACCOUNT
--group GROUP which group to remove ACCOUNT as a member of
--account ACCOUNT which account to remove as a member of GROUP
2023-07-07 17:00:02 +08:00
The specified account will no longer be able to access all present and future servers
2020-10-16 00:32:37 +08:00
pertaining to this group.
Note that if this account also had specific guest accesses to this group, they may
still apply, see ``groupListGuestAccesses``
EOF
);
my $fnret = OVH::Bastion::Plugin::groupSetRole::act(
account => $account,
group => $group,
action => 'del',
type => 'member',
sudo => 0,
silentoverride => 0,
self => $self,
scriptName => $scriptName,
savedArgs => $savedArgs
);
help() if not $fnret;
osh_exit($fnret);