mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
rename role
This commit is contained in:
@@ -247,7 +247,6 @@ EOF
|
|||||||
error=$(echo $response | jq .error)
|
error=$(echo $response | jq .error)
|
||||||
fail "Failed to submit request to Hydra: $error"
|
fail "Failed to submit request to Hydra: $error"
|
||||||
fi
|
fi
|
||||||
addClientPermission "$id" "$perm"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function manage_user() {
|
|||||||
add)
|
add)
|
||||||
email=$(echo "$request" | jq -r .email)
|
email=$(echo "$request" | jq -r .email)
|
||||||
password=$(echo "$request" | jq -r .password)
|
password=$(echo "$request" | jq -r .password)
|
||||||
role=$(echo "$request" | jq -r .role)
|
perm=$(echo "$request" | jq -r .role)
|
||||||
firstName=$(echo "$request" | jq -r .firstName)
|
firstName=$(echo "$request" | jq -r .firstName)
|
||||||
lastName=$(echo "$request" | jq -r .lastName)
|
lastName=$(echo "$request" | jq -r .lastName)
|
||||||
note=$(echo "$request" | jq -r .note)
|
note=$(echo "$request" | jq -r .note)
|
||||||
@@ -166,11 +166,10 @@ function manage_client() {
|
|||||||
while [[ $tries -lt $max_tries ]]; do
|
while [[ $tries -lt $max_tries ]]; do
|
||||||
case "$op" in
|
case "$op" in
|
||||||
add)
|
add)
|
||||||
role=$(echo "$request" | jq -r .role)
|
|
||||||
name=$(echo "$request" | jq -r .name)
|
name=$(echo "$request" | jq -r .name)
|
||||||
note=$(echo "$request" | jq -r .note)
|
note=$(echo "$request" | jq -r .note)
|
||||||
log "Performing client '$op' for client with name '$name', note '$note' and role '$role'"
|
log "Performing client '$op' for client with name '$name' and note '$note'"
|
||||||
response=$(so-client "$op" --name "$name" --note "$note" --role "$role" --json)
|
response=$(so-client "$op" --name "$name" --note "$note" --json)
|
||||||
webResponse=$response
|
webResponse=$response
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
;;
|
;;
|
||||||
@@ -180,11 +179,11 @@ function manage_client() {
|
|||||||
response=$(so-client "$op" --id "$client_id")
|
response=$(so-client "$op" --id "$client_id")
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
;;
|
;;
|
||||||
addrole|delrole)
|
addperm|delperm)
|
||||||
client_id=$(echo "$request" | jq -r .id)
|
client_id=$(echo "$request" | jq -r .id)
|
||||||
role=$(echo "$request" | jq -r .role)
|
perm=$(echo "$request" | jq -r .permission)
|
||||||
log "Performing '$op' for client '$client_id' with role '$role'"
|
log "Performing '$op' for client '$client_id' with permission '$perm'"
|
||||||
response=$(so-client "$op" --id "$client_id" --role "$role")
|
response=$(so-client "$op" --id "$client_id" --permission "$perm")
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
;;
|
;;
|
||||||
generate-secret)
|
generate-secret)
|
||||||
|
|||||||
Reference in New Issue
Block a user