From e659a4a819b10c3f1a2083a49014b4df96189c47 Mon Sep 17 00:00:00 2001 From: Travis Smith Date: Sun, 8 Sep 2024 06:35:09 -0500 Subject: [PATCH] Add has_role_# in addition to the current has_role_X (Discussion #4378) There is a small chance of collision if some maniac has named a member role as a) only a number (is this even possible?) and b) that number name does not match the member role id number, but frankly, those sorts of people deserve what's coming to them. --- system/ee/legacy/libraries/Template.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/ee/legacy/libraries/Template.php b/system/ee/legacy/libraries/Template.php index f30b24b443..8b9e001279 100644 --- a/system/ee/legacy/libraries/Template.php +++ b/system/ee/legacy/libraries/Template.php @@ -4562,6 +4562,7 @@ protected function getMemberVariables() $value = in_array($role->getId(), $assigned_role_ids); $vars['has_role_' . $role->short_name] = $value; + $vars['has_role_' . $role->role_id] = $value; } }