mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Return all perms for superusers
This commit is contained in:
parent
b99422da12
commit
c1a1f6d74e
@ -2,6 +2,7 @@ import itertools
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib
|
import urllib
|
||||||
import uuid
|
import uuid
|
||||||
@ -883,7 +884,8 @@ class UiSettingsView(GenericAPIView):
|
|||||||
ui_settings["update_checking"] = {
|
ui_settings["update_checking"] = {
|
||||||
"backend_setting": settings.ENABLE_UPDATE_CHECK,
|
"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(
|
return Response(
|
||||||
{
|
{
|
||||||
"user_id": user.id,
|
"user_id": user.id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user