From c1a6fc050d5b429daf47bd9bdb63fe8c884bc3af Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 11 May 2017 22:17:42 -0400 Subject: [PATCH] Simplify can_access for instance groups on job templates --- awx/main/access.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index a875166149..3bd172bc13 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -1312,9 +1312,7 @@ class JobTemplateAccess(BaseAccess): if isinstance(sub_obj, NotificationTemplate): return self.check_related('organization', Organization, {}, obj=sub_obj, mandatory=True) if relationship == "instance_groups": - if self.user.can_access(type(sub_obj), "read", sub_obj) and self.user in obj.project.organization.admin_role: - return True - return False + return self.user.can_access(type(sub_obj), "read", sub_obj) and self.user in obj.project.organization.admin_role return super(JobTemplateAccess, self).can_attach( obj, sub_obj, relationship, data, skip_sub_obj_read_check=skip_sub_obj_read_check)