mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
remove the User.object_roles view
This commit is contained in:
@@ -1201,19 +1201,6 @@ class UserRolesList(SubListCreateAttachDetachAPIView):
|
|||||||
# We hide roles that shouldn't be seen in our queryset
|
# We hide roles that shouldn't be seen in our queryset
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class UserObjectRolesList(SubListAPIView):
|
|
||||||
|
|
||||||
model = Role
|
|
||||||
serializer_class = RoleSerializer
|
|
||||||
parent_model = User
|
|
||||||
new_in_300 = True
|
|
||||||
|
|
||||||
def get_queryset(self):
|
|
||||||
po = self.get_parent_object()
|
|
||||||
content_type = ContentType.objects.get_for_model(self.parent_model)
|
|
||||||
return Role.objects.filter(content_type=content_type, object_id=po.pk)
|
|
||||||
|
|
||||||
|
|
||||||
class UserProjectsList(SubListAPIView):
|
class UserProjectsList(SubListAPIView):
|
||||||
|
|
||||||
model = Project
|
model = Project
|
||||||
|
|||||||
Reference in New Issue
Block a user