mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Fix AC-263 and AC-264. Update how we check for access to item referenced via foreign key, and determining whether an immutable field has changed.
This commit is contained in:
@@ -285,13 +285,6 @@ class ProjectOrganizationsList(SubListCreateAPIView):
|
||||
parent_model = Project
|
||||
relationship = 'organizations'
|
||||
|
||||
def get_queryset(self):
|
||||
# FIXME: Default get_queryset should handle this.
|
||||
project = Project.objects.get(pk=self.kwargs['pk'])
|
||||
if not self.request.user.is_superuser:
|
||||
raise PermissionDenied()
|
||||
return Organization.objects.filter(projects__in = [ project ])
|
||||
|
||||
class ProjectTeamsList(SubListCreateAPIView):
|
||||
|
||||
model = Team
|
||||
@@ -299,12 +292,6 @@ class ProjectTeamsList(SubListCreateAPIView):
|
||||
parent_model = Project
|
||||
relationship = 'teams'
|
||||
|
||||
def get_queryset(self):
|
||||
project = Project.objects.get(pk=self.kwargs['pk'])
|
||||
if not self.request.user.is_superuser:
|
||||
raise PermissionDenied()
|
||||
return Team.objects.filter(projects__in = [ project ])
|
||||
|
||||
class UserList(ListCreateAPIView):
|
||||
|
||||
model = User
|
||||
|
||||
Reference in New Issue
Block a user