From 4aef4981871a5aa222307307dd49ef387aac3e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mac=C3=ADk?= Date: Fri, 3 Oct 2025 15:55:32 +0200 Subject: [PATCH] feat(rbac_nested): Reverse order users are assigned into nested groups to get the first user under deepest nesting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel MacĂ­k --- ci-scripts/rhdh-setup/create_resource.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci-scripts/rhdh-setup/create_resource.sh b/ci-scripts/rhdh-setup/create_resource.sh index acb592e..c6316d5 100755 --- a/ci-scripts/rhdh-setup/create_resource.sh +++ b/ci-scripts/rhdh-setup/create_resource.sh @@ -417,10 +417,12 @@ create_user() { ;; "$RBAC_POLICY_NESTED_GROUPS") [[ $grp -eq 0 ]] && grp=${GROUP_COUNT} - if [[ $grp -eq 1 || $grp -gt ${RBAC_POLICY_SIZE} ]]; then + if [[ $grp -eq $RBAC_POLICY_SIZE ]]; then + groups="$groups\"g1\"" + elif [[ $grp -gt ${RBAC_POLICY_SIZE} ]]; then groups="$groups\"g${grp}\"" else - group_name="g$((grp - 1))_1" + group_name="g$((RBAC_POLICY_SIZE - grp))_1" group_path=$(get_group_path_by_name "$group_name") groups="$groups\"$group_path\"" fi