Return all perms for superusers

This commit is contained in:
Michael Shamoon 2022-12-08 11:10:13 -08:00
parent b99422da12
commit c1a1f6d74e

View File

@ -2,6 +2,7 @@ import itertools
import json
import logging
import os
import re
import tempfile
import urllib
import uuid
@ -883,7 +884,8 @@ class UiSettingsView(GenericAPIView):
ui_settings["update_checking"] = {
"backend_setting": settings.ENABLE_UPDATE_CHECK,
}
roles = user.user_permissions.values_list("codename", flat=True)
# strip <app_label>.
roles = map(lambda perm: re.sub(r"^\w+.", "", perm), user.get_all_permissions())
return Response(
{
"user_id": user.id,