Created
September 12, 2023 07:42
-
-
Save msdousti/065d23ff3b7a6d69cd46ecce0b03d234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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