mirror of
https://src.koozali.org/infra/smeserver-koji.git
synced 2024-11-21 17:17:28 +01:00
add permissions
This commit is contained in:
parent
1e9e198945
commit
6fdbc0c9ca
@ -4,11 +4,13 @@ set -e
|
|||||||
DEBUG=
|
DEBUG=
|
||||||
SILENT="-s"
|
SILENT="-s"
|
||||||
QUIET="-q"
|
QUIET="-q"
|
||||||
for param in $1 $2 ; do
|
for param in $1 $2 $3 ; do
|
||||||
if [ $param ] ; then
|
if [ $param ] ; then
|
||||||
case $param in
|
case $param in
|
||||||
debug )
|
debug )
|
||||||
DEBUG="debug" ;;
|
DEBUG="debug" ;;
|
||||||
|
perms=* )
|
||||||
|
NEW_PERMS=${param#*=} ;;
|
||||||
* )
|
* )
|
||||||
NEW_USER=$param ;;
|
NEW_USER=$param ;;
|
||||||
esac
|
esac
|
||||||
@ -40,6 +42,9 @@ fi
|
|||||||
|
|
||||||
# Add the new user into the database
|
# Add the new user into the database
|
||||||
sudo -u kojiadmin koji add-user "$NEW_USER"
|
sudo -u kojiadmin koji add-user "$NEW_USER"
|
||||||
|
if [ $NEW_PERMS ] ; then
|
||||||
|
sudo -u kojiadmin koji grant-permission --new $NEW_PERMS $NEW_USER
|
||||||
|
fi
|
||||||
# Generate a certificate for the user
|
# Generate a certificate for the user
|
||||||
pushd "$KOJI_PKI_DIR"
|
pushd "$KOJI_PKI_DIR"
|
||||||
$SCRIPT_DIR/koji-gencert.sh "$NEW_USER" "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/CN=$NEW_USER"
|
$SCRIPT_DIR/koji-gencert.sh "$NEW_USER" "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/CN=$NEW_USER"
|
||||||
|
Loading…
Reference in New Issue
Block a user