core: fix users's system_permissions not including role permissions
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -227,9 +227,9 @@ class UserSelfSerializer(ModelSerializer):
|
|||||||
def get_system_permissions(self, user: User) -> list[str]:
|
def get_system_permissions(self, user: User) -> list[str]:
|
||||||
"""Get all system permissions assigned to the user"""
|
"""Get all system permissions assigned to the user"""
|
||||||
return list(
|
return list(
|
||||||
user.user_permissions.filter(
|
x.split(".", maxsplit=1)[1]
|
||||||
content_type__app_label="authentik_rbac", content_type__model="systempermission"
|
for x in user.get_all_permissions()
|
||||||
).values_list("codename", flat=True)
|
if x.startswith("authentik_rbac")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user