Merge pull request #2714 from wwitzel3/issue-2706

ensure the singleton roles show up for sys auditor / sys admins
This commit is contained in:
Wayne Witzel III
2016-07-01 11:11:58 -04:00
committed by GitHub
2 changed files with 21 additions and 0 deletions

View File

@@ -1192,6 +1192,7 @@ class UserRolesList(SubListCreateAttachDetachAPIView):
if not self.request.user.can_access(User, 'read', u):
raise PermissionDenied()
content_type = ContentType.objects.get_for_model(User)
return Role.filter_visible_roles(self.request.user, u.roles.all()) \
.exclude(content_type=content_type, object_id=u.id)