mirror of https://github.com/ovh/the-bastion
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
#! /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 ($account, $group);
|
|
my $remainingOptions = OVH::Bastion::Plugin::begin(
|
|
argv => \@ARGV,
|
|
header => "grant an account as gatekeeper of a group",
|
|
options => {"account=s", \$account, "group=s", \$group},
|
|
helptext => <<'EOF',
|
|
Add the group gatekeeper role to an account
|
|
|
|
Usage: --osh SCRIPT_NAME --group GROUP --account ACCOUNT
|
|
|
|
--group GROUP which group to set ACCOUNT as a gatekeeper of
|
|
--account ACCOUNT which account to set as a gatekeeper of GROUP
|
|
|
|
The specified account will be able to manage the members list of this group,
|
|
along with the guests list
|
|
EOF
|
|
);
|
|
|
|
my $fnret = OVH::Bastion::Plugin::groupSetRole::act(
|
|
account => $account,
|
|
group => $group,
|
|
action => 'add',
|
|
type => 'gatekeeper',
|
|
sudo => 0,
|
|
silentoverride => 0,
|
|
self => $self,
|
|
scriptName => $scriptName,
|
|
savedArgs => $savedArgs
|
|
);
|
|
help() if not $fnret;
|
|
osh_exit($fnret);
|