Skip to content

Commit 89386b9

Browse files
Derive groups from group_names
1 parent cd380ef commit 89386b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pulpcore/app/workload_identity/principal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ def __init__(self, grants, username=""):
2525

2626
@property
2727
def groups(self):
28-
"""An empty ``Group`` queryset so ``user.groups.all()`` never crashes."""
28+
"""The ``Group`` objects named by ``group_names`` (empty by default)."""
2929
from pulpcore.app.models import Group
3030

31-
return Group.objects.none()
31+
return Group.objects.filter(name__in=self.group_names)
3232

3333
def has_perm(self, perm, obj=None):
3434
"""Whether the grants confer ``perm`` (optionally scoped to ``obj``)."""

0 commit comments

Comments
 (0)