Skip to content

Commit

Permalink
rbac: fix incorrect object_description for object-level permissions (#…
Browse files Browse the repository at this point in the history
…12029)

Signed-off-by: Jens Langhammer <[email protected]>
  • Loading branch information
BeryJu authored Nov 15, 2024
1 parent fcbee2e commit 0bdef2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion authentik/rbac/api/rbac_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_object_description(self, instance: GroupObjectPermission) -> str | None:
except LookupError:
return None
objects = get_objects_for_group(instance.group, f"{app_label}.view_{model}", model_class)
obj = objects.first()
obj = objects.filter(pk=instance.object_pk).first()
if not obj:
return None
return str(obj)
Expand Down
2 changes: 1 addition & 1 deletion authentik/rbac/api/rbac_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_object_description(self, instance: UserObjectPermission) -> str | None:
except LookupError:
return None
objects = get_objects_for_user(instance.user, f"{app_label}.view_{model}", model_class)
obj = objects.first()
obj = objects.filter(pk=instance.object_pk).first()
if not obj:
return None
return str(obj)
Expand Down

0 comments on commit 0bdef2a

Please sign in to comment.