Skip to content

Commit

Permalink
Merge pull request #105 from aztfmod/owner-permissions-fix
Browse files Browse the repository at this point in the history
Fix - Update searching for subscription owner role
  • Loading branch information
LaurentLesle authored Feb 1, 2021
2 parents 689ea03 + 7aa255f commit 62fc952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function verify_azure_session {

function check_subscription_required_role {
echo "@checking if current user (object_id: ${TF_VAR_logged_user_objectId}) is ${1} of the subscription - only for launchpad"
role=$(az role assignment list --role "${1}" --assignee ${TF_VAR_logged_user_objectId})
role=$(az role assignment list --role "${1}" --assignee ${TF_VAR_logged_user_objectId} --include-inherited --include-groups)

if [ "${role}" == "[]" ]; then
error ${LINENO} "the current account must have ${1} privilege on the subscription to deploy launchpad." 2
Expand Down Expand Up @@ -1073,4 +1073,4 @@ function process_target_subscription {
echo "Tfstates subscription set to ${TF_VAR_tfstate_subscription_id} (${tfstate_subscription_name})"
echo ""

}
}

0 comments on commit 62fc952

Please sign in to comment.