NORY-36: refactor admin-role script to curl command
This commit is contained in:
parent
1e93ced78b
commit
9d5e19a91e
1 changed files with 11 additions and 6 deletions
|
@ -10,10 +10,15 @@ fi
|
||||||
# set user id variable
|
# set user id variable
|
||||||
IDENTITY_ID=$1
|
IDENTITY_ID=$1
|
||||||
|
|
||||||
# execute Ory Keto CLI command to make user an admin
|
# execute curl to Ory Keto write endpoint
|
||||||
docker compose exec ory-keto \
|
curl --request PUT \
|
||||||
ory create relation-tuples \
|
--url http://localhost:4467/admin/relation-tuples \
|
||||||
\{'namespace':'roles','object':'admin','relation':'member','subject_id':IDENTITY_ID}
|
--data '{
|
||||||
|
"namespace": "roles",
|
||||||
|
"object": "admin",
|
||||||
|
"relation": "member",
|
||||||
|
"subject_id": "'"$IDENTITY_ID"'"
|
||||||
|
}'
|
||||||
|
|
||||||
# respond with success message
|
# write success response to terminal
|
||||||
echo "Identity $IDENTITY_ID was given the admin role."
|
echo "Applied admin role to the user with ID $IDENTITY_ID"
|
||||||
|
|
Loading…
Add table
Reference in a new issue