Skip to content
Snippets Groups Projects
Verified Commit 1ba28f45 authored by Mark's avatar Mark
Browse files

Add util scripts to manage roles

parent 5ee76d3d
No related branches found
No related tags found
1 merge request!1Integration
#!/bin/bash
USERNAME=$1
ROLE=$2
SERVER=$3
PORT=$4
if [[ $USERNAME == "" ]] || [[ $ROLE == "" ]]; then
echo "Please specify username and role"
exit 1
fi
if [[ $SERVER == "" ]]; then
SERVER=localhost
fi
if [[ $PORT == "" ]]; then
PORT=5000
fi
echo "Assigning role $ROLE to User $USERNAME"
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"query\": \"mutation {addRoleToUser(username: \\\"$USERNAME\\\", role: \\\"$ROLE\\\"){user{username, roles{edges{node{name}}}}}}\" }" \
http://$SERVER:$PORT/graphql
#!/bin/bash
ROLE=$1
SERVER=$2
PORT=$3
if [[ $ROLE == "" ]]; then
echo "Please specify a role name"
exit 1
fi
if [[ $SERVER == "" ]]; then
SERVER=localhost
fi
if [[ $PORT == "" ]]; then
PORT=5000
fi
echo "Creating role $ROLE"
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"query\": \"mutation {createRole(name: \\\"$ROLE\\\"){role{name}}}\" }" \
http://$SERVER:$PORT/graphql
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment