mirror of
https://github.com/ansible/awx.git
synced 2026-10-31 06:26:15 -02:30
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:
+4
-2
@@ -711,10 +711,12 @@ class UserAccess(BaseAccess):
|
|||||||
return False
|
return False
|
||||||
if settings.ANSIBLE_BASE_ROLE_SYSTEM_ACTIVATED:
|
if settings.ANSIBLE_BASE_ROLE_SYSTEM_ACTIVATED:
|
||||||
target_perms = set(
|
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(
|
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')
|
.values_list('object_id', 'content_type_id', 'codename')
|
||||||
.distinct()
|
.distinct()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, ExecutionEn
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
RoleEvaluation.objects.filter(
|
RoleEvaluation.objects.filter(
|
||||||
**RoleEvaluation._actor_role_filter(accessor),
|
role_id__in=RoleEvaluation.actor_role_ids(accessor),
|
||||||
codename__in=all_codenames,
|
codename__in=all_codenames,
|
||||||
content_type_id__in=[ct.id for ct in dab_role_cts],
|
content_type_id__in=[ct.id for ct in dab_role_cts],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user