NORY-36: add script to assign admin role to identity

This commit is contained in:
Markus Thielker 2024-12-16 00:25:47 +01:00
parent 40a46f6457
commit 67758135c3
No known key found for this signature in database

View file

@ -0,0 +1,19 @@
# this script gives the referenced identity the admin role
# make sure to provide the id of the identity
# check if a identity id argument was provided
if [ -z "$1" ]; then
echo "Error: please provide an identity id."
exit 1
fi
# set user id variable
IDENTITY_ID=$1
# execute Ory Keto CLI command to make user an admin
docker compose exec ory-keto \
ory create relation-tuples \
\{'namespace':'roles','object':'admin','relation':'member','subject_id':IDENTITY_ID}
# respond with success message
echo "Identity $IDENTITY_ID was given the admin role."