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
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu committed Nov 14, 2024
1 parent bcb91d2 commit 26f7469
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()

Check warning on line 56 in authentik/rbac/api/rbac_roles.py

View check run for this annotation

Codecov / codecov/patch

authentik/rbac/api/rbac_roles.py#L56

Added line #L56 was not covered by tests
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()

Check warning on line 56 in authentik/rbac/api/rbac_users.py

View check run for this annotation

Codecov / codecov/patch

authentik/rbac/api/rbac_users.py#L56

Added line #L56 was not covered by tests
if not obj:
return None
return str(obj)
Expand Down

0 comments on commit 26f7469

Please sign in to comment.