Migrate from deprecated _actor_role_filter to actor_role_ids (#16750)

DAB PR #1105 added actor_role_ids() as the public API and deprecated
_actor_role_filter. Update all AWX callers to use the new method.

Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jake Jackson
2026-10-23 09:53:44 -04:00
committed by GitHub
parent e9ad241416
commit edabe5d6eb
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -711,10 +711,12 @@ class UserAccess(BaseAccess):
return False
if settings.ANSIBLE_BASE_ROLE_SYSTEM_ACTIVATED:
target_perms = set(
RoleEvaluation.objects.filter(**RoleEvaluation._actor_role_filter(obj)).values_list('object_id', 'content_type_id', 'codename').distinct()
RoleEvaluation.objects.filter(role_id__in=RoleEvaluation.actor_role_ids(obj))
.values_list('object_id', 'content_type_id', 'codename')
.distinct()
)
user_perms = set(
RoleEvaluation.objects.filter(**RoleEvaluation._actor_role_filter(self.user))
RoleEvaluation.objects.filter(role_id__in=RoleEvaluation.actor_role_ids(self.user))
.values_list('object_id', 'content_type_id', 'codename')
.distinct()
)
+1 -1
View File
@@ -234,7 +234,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, ExecutionEn
return (
RoleEvaluation.objects.filter(
**RoleEvaluation._actor_role_filter(accessor),
role_id__in=RoleEvaluation.actor_role_ids(accessor),
codename__in=all_codenames,
content_type_id__in=[ct.id for ct in dab_role_cts],
)