Skip to content

Instantly share code, notes, and snippets.

@msdousti
Created September 12, 2023 07:42
Show Gist options
  • Save msdousti/065d23ff3b7a6d69cd46ecce0b03d234 to your computer and use it in GitHub Desktop.
Save msdousti/065d23ff3b7a6d69cd46ecce0b03d234 to your computer and use it in GitHub Desktop.
#!/bin/bash
users=("cantony" "hadmohammadi" "helseoudy" "mmorsy" "mtaufikakbar" "pebermann" "rogupta" "sdousti" "tschlage" "yzykau")
token=`ztoken`
for user in ${users[*]}; do
has_role=$(curl -sH "Authorization: Bearer $token" https://users.auth.zalando.com/api/employees/$user/groups | jq '.[] | select(.dn | contains("24x7 Emergency,ou=Retail Operations")) | length > 0')
echo "$user: $has_role"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment